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.
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.
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_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
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.