Table of Content
What is compression?
When a user hits your website a call is made to your server to deliver the requested files. The bigger these files are the longer it’s going to take for them to get to your browser and appear on the screen. Gzip/Brotli compresses your webpages and objects before sending them over to the browser. This drastically reduces transfer time since the files are much smaller. In terms of cost versus benefit, compression should be near the top of your page speed optimizations if you don’t have it setup already.
How does it work?
Gzip/Brotli is actually a fairly simple idea that is extremely powerful when put to good use. Gzip/Brotli locates similar strings within a text file and replaces those strings temporarily to make the overall file size smaller.
The reason gzip/Brotli works so well in a web environment is because CSS files and HTML files use a lot of repeated text and have loads of whitespace. Since gzip/Brotli compresses common strings, this can reduce the size of pages and style sheets by up to 70-90%!
When a browser visits a webserver it checks to see if the server has gzip/Brotli enabled and requests the webpage. If it’s enabled it receives the gzip/Brotli file which is significantly smaller and if it isn’t, it still receives the page, only the uncompressed version which is much larger.
Why is it important?
The main reason it is important is because it reduces the time it takes for a website to transfer the page files and style sheets which ultimately reduces the load time of your website.
How to check
To check if your browser (well, all modern browsers do…) and your server can use compression to transfer your website you can use this website:
https://www.giftofspeed.com/gzip-test/
Just enter your URL and you will find results:
![](https://www.sliderrevolution.com/wp-content/uploads/2019/10/Screenshot-2019-10-31-at-13.05.39-1024x747.png)
How to enable
There are different methods of setting up gzip/Brotli compression depending on whether or not you’ve got an IIS or Apache server (or something else entirely).
Contact your WebHosting support to enable this feature for your website if you don’t have it already!