Rule n° 226 - The server transmits compressed contents to the clients which accept them.
This is a particularly effective way of speeding up page access time and reducing bandwidth costs: a server can be configured to send compressed pages (in a format similar to that of a .zip archive). The contents are then "unzipped" on the fly and in a totally transparent manner on the user's workstation.
Goal
- Improve the speed of the page’s rendering.
- Reduce bandwidth costs.
- Reduce the energy impact related to the consultation of the site.
Solution technique
Activate the server's Gzip or Deflate module to compress JavaScript, CSS and HTML resources.
Moyen de contrôle
For each page checked:
- Check the content compression (Gzip) using a dedicated tool.
Be careful to check all of the linked elements (CSS, JS, HTML) and not just the page itself. Formats such as JPEG or PNG images or zip files which are already compressed, for example, should not be recompressed. If
the size before compression of an element is less than 1 kB, it is not necessary to compress it, because the size might increase.