
Enable Gzip Compression To Improve Website Score
- September 22, 2015
- Leave a comment
You have to implement a number of practices in order to improve your website’s score on Google PageSpeed Insight. One of the most important practice that can boost your website’s score is Gzip Compression. Gzip compression is used for compression and decompression of files. Basically it is a format or you can say a software application. This was created by Mark Adler and Jean-Loup Gailly as a free software replacement for the compression program used in early Unix systems.
Implementation:
In order to implement Gzip compression in your website, simply add the following code in your .htaccess file. This file is located in the root of your website at Server.
1 2 3 4 5 6 7 8 9 10 |
<ifModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file .(html?|txt|css|js|php|pl)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^image/.* mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* </ifModule> |
To see its effect on your website, you can test your website’s score on Google PageSpeed Insight before and after adding the above code.
User Comments