GZIP Compression Test

You can find out if GZIP compression is enabled on your website by doing a GZIP compression test. What is GZIP compression? Find out here.

What is GZIP?

GZIP (GNU zip) is a file format, software application used for file compression and decompression. Gzip compression is enabled on the server side and provides further reduction in the size of your html, style and Javascript files. Gzip compression does not work on images as they are already compressed differently. Some files show a reduction of almost over 70% thanks to Gzip compression.

When a web browser visits a website, it checks if the web server is GZIP-enabled by looking for the "content encoding: gzip" response header. If header is detected, it will serve compressed and smaller files. If not, it decompresses uncompressed files. If you don't have GZIP enabled, you'll likely see warnings and errors in speed testing tools like Google PageSpeed ​​Insights and GTMetrix. Since site speed is an important factor for SEO today, it is especially useful to enable Gzip compression for your WordPress sites.

What is GZIP compression?

Gzip compression; It affects the speed of the website and therefore it is one of the situations where search engines are also sensitive. When gzip compression is done, the speed of the website increases. A significant difference can be seen when comparing the speed before activating gzip compression with the speed after it is done. Along with reducing the size of the page, it also increases its performance. On sites where gzip compression is not enabled, errors may occur in the speed tests performed by SEO experts. That's why enabling gzip compression becomes mandatory for all sites. After enabling gzip compression, it can be checked with test tools whether the compression is active or not.

Looking at the meaning of gzip compression; It is the name given to the process of reducing the size of the pages on the web server before they are sent to the visitor's browser. It has advantages such as saving bandwidth and faster loading and viewing of pages. Visitor web browser pages open automatically, while compression and decompression takes place in just a fraction of a second during this time.

What does gzip compression do?

Looking at the purpose of gzip compression; It is to help reduce the loading time of the site by shrinking the file. When the visitor wants to enter the website, a request is sent to the server so that the requested file can be retrieved. The larger the size of the requested files, the longer it takes to load the files. In order to reduce this time, web pages and CSS must be gzip compressed before they are sent to the browser. When the loading speed of the pages increases with gzip compression, this also provides an advantage in terms of SEO. Gzip compression on WordPress sites is becoming a necessity.

Just as people prefer to compress this file when they want to send a file to someone; The reason for gzip compression is the same. The main difference between the two is; When the gzip compression process is performed, this transfer between the server and the browser occurs automatically.

Which browsers support GZIP?

Site owners do not need to worry about Gzip browser support. It has been supported by the vast majority of browsers for an average of 17 years. Here are the browsers and when they started to support gzip compression:

  • Internet Explorer 5.5+ has been providing gzip support since July 2000.
  • Opera 5+ is a browser that supports gzip since June 2000.
  • Since October 2001 Firefox 0.9.5+ has had gzip support.
  • Right after it was released in 2008, Chrome was included in the browsers that support gzip.
  • After its first launch in 2003, Safari has also become one of the browsers that support gzip.

How to compress Gzip?

If it is necessary to briefly explain the logic of gzip compression; It ensures that similar strings are found in a text file, and with the temporary replacement of these similar strings, there is a reduction in the total file size. Especially in HTML and CSS files, since the number of repeated text and spaces is higher than other file types, more benefits are provided when gzip compression is applied in these file types. It is possible to compress the page and CSS size between 60% and 70% with gzip. With this process, although the site is faster, the CPU used is more. Therefore, site owners should check and make sure that their CPU usage is stable before enabling gzip compression.

How to enable gzip compression?

Mod_gzip or mod_deflate can be used to enable gzip compression. If it is recommended between the two methods; mod_deflate. Compressing with mod_deflate is more preferred because it has a better conversion algorithm and is compatible with a higher apache version.

Here are the gzip compression enable options:

  • It is possible to enable gzip compression by editing the .htaccess file.
  • Gzip compression can be enabled by installing plugins for content management systems.
  • It is possible for those with a cPanel license to enable gzip compression.
  • With Windows-based hosting, gzip compression can be enabled.

GZIP compression with htaccess

To enable gzip compression by modifying the .htaccess file, code needs to be added to the .htaccess file. It is recommended to use mod_deflate when adding code. However, if the site owner's server does not support mod_deflate; Gzip compression can also be enabled with mod_gzip. After the code has been added, the changes must be saved in order for gzip compression to be enabled. In cases where some hosting companies do not allow gzip compression using the panel, it is preferred to enable gzip compression by editing the .htaccess file.

GZIP compression with cPanel

To enable gzip compression with cPanel, the site owner must have a cPanel license. User must login to the hosting panel using their username and password. Activation can be completed from the gzip activation section at the bottom of the site owner's hosting account via the Optimize Website section under the Software/Services heading. First of all, Compress All Content and then Update Settings buttons should be clicked, respectively.

GZIP compression with Windows server

Windows server users must use the command line to enable gzip compression. They can enable http compression for static and dynamic content with the following codes:

  • Static content: appcmd set config /section:urlCompression /doStaticCompression:True
  • Dynamic content: appcmd set config /section:urlCompression /doDynamicCompression:True

How to do a gzip compression test?

There are some tools that can be used to test gzip compression. When these tools are used, the lines that can be compressed are listed one by one before enabling gzip compression. However, when the test tools are used after enabling gzip compression, there is a notification on the screen that there is no further compression to be done.

You can find out online on the website whether GZIP compression is enabled with the "Gzip compression test" tool, a free Softmedal service. In addition to being easy and fast to use, it also shows detailed results to site owners. After the link of the site is written to the relevant address, the gzip compression can be tested when the check button is clicked.