Smaller file sizes help you to achieve faster loading time on your WordPress Site. The size of your webpage can be reduced by using Gzip compression.
Also, google alerts for sites that do not have compression enabled. In this guide, you will learn how to enable Gzip compression to your WordPress website by modifying the .htaccess file.
How does Gzip Compression Work?
The working of Gzip compression is very simple. It uses an algorithm which organizes repeated strings in a single place only, instead of saving those same strings again and again.
And it manages those strings with their location values while compression and retrieving data back from compressed files. Gzip compression works fine with stylesheets and web pages because all these resource files have many repeated strings. Because of its compression technique, Gzip can reduce the file size by 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.
How to Enable Gzip Compression
You will need to add the following lines to your .htaccess file:
Click on Save Changes to save your changes.
There are WordPress plugins available which can help to enable to Gzip compression to your site. W3 Total Cache is one of the most used popular caching plugins on WordPress. Using this plugin, you can enable Gzip compression.
You can enable Gzip compression with W3 Total cache by going to its settings page. Go to the Browser cache page. Enable the HTTP compression option and click on Save Changes.