Gzip Compressions

What is Gzip Compressions?

GZIP is a file format that is used for compressing and decompressing a file. It was first released to the public in 1992. It was developed by the GNU Project, and Jean-loup Gailly and Mark Adler were the authors of the free GZIP software application. 

GZIP is usually used to compress single files. Essentially, it takes chunks of content and reduces its size. By making the files smaller in size, GZIP allows them to be transferred much faster over a network when compared to a non-compressed file. The original data is restored by unzipping the compressed files.

Why is Compression Important?

Improves page speed

HTML or CSS files that have been compressed using GZIP can save anywhere between fifty to seventy percent of the file size. As a result of this, web pages take lesser time to load, rendering the page much faster for the user’s view.

GZIP compression helps save bandwidth and all modern browsers accept GZIP compressed files.

Let's imagine the web browser and the server to be two people talking to each other.

Browser: Server, can I get index.html? 

Server: Hello Browser. I found index.html which is 100 kb. Let me zip it for you and send it Browser: Thanks! The zipped file is just 10 kb. I’ll unzip it and display it to the user.

While this is in a conversational tone for better understanding, what really happens is that the browser sends a header to let the server know that it accepts zip files. 

The header content will look something like this - Accept-Encoding: GZIP, deflate (GZIP and deflate are compression methods) If the file has been compressed by the server, it will send a response like this - Content-Encoding: GZIP

How to Enable Gzip Compression?

GZIP compression is enabled through web server configuration including compression via Apache, Litespeed, Nginx and .htaccess web servers. It can compress all types of files. However, some file formats are compressed more effectively than others. 

For instance, text files including HTML files are compressed well using GZIP compression. On the other hand, images are not compressed by GZIP as well, since they already have built-in compression.

Things To Keep In Mind?

  1. Older versions of browsers may have trouble accepting compressed files. For such browsers, you may want to avoid compression.
  2.  GZIP performs best on text-based files including HTML, CSS, and Javascript.
  3. Most images and videos, by virtue of their large sizes, are already compressed, so you need not spend time compressing them again.
  4. While most servers automatically compress files when serving the user, some require manual effort to ensure that GZIP compression is being done. It is recommended that you audit your site to ensure that your files are being compressed to deliver optimum results to the users.
  5. GZIP compression happens across HTTP and is the end-user is completely unaware of the behind-the-scenes-works.

Keep Learning more from our Learn Technical SEO guides. Do Technical SEO Audit yourself for free here.

Start generating Leads today

No credit card required – Get started in seconds