Skip to main content

All the questions related to Gzip compression in a Sitecore website.

Compression is a simple, effective way to save bandwidth and speed up your site. IIS supports multiple types of compression. The widely used one for a long time is Gzip.

Website gzip compression makes it possible to reduce the file size of a web file (like HTML, PHP, CSS and Javascript files) to about 30% or less of its original size before these files get sent to the browser of a user. This compressed file is then served to the browser of the user which in turn decompresses it automatically to load the full original file in the browser again. Enabling gzip compression is great for improving page speed because your visitors will need to download much smaller web files as the original ones when browsing your web pages, which speeds up the download process of these files.

For a file transfer to work with GZIP, two things must happen.

First, the web browser tells the web server that it can accept GZIP-compressed files. This is accomplished by including the Accept-Encoding: gzip, deflate in the browser’s request.

Second, the webserver processes this header and decides to either compress the requested files or leave them be. If the files are compressed with GZIP, the server includes the following header in its response: Content-Encoding: gzip