Gzip compression is very helpful to boost the speed of a website. By enabling developer can reduce the server load . In this article you will learn how to enable Gzip compression using the following in .htaccess .
- Tips to Boost Website Speed
- How To Reduce Website Loading Time Using Page Speed Insights
- Easy Way To Compress HTML Delivery
The .htaccess file controls many important things for your site.
Steps to Enable Gzip Compression
Login to your Cpanel and then locate the File Manager. Under the File Manager folder locate the file .htaccess . If this file not exist in it ,then you have to create the it . Learn how to create how to create and edit .htaccess file.
.htaccess looks like as the upper image. If it is already existed in the folder ,then open it and write the following code in it.
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.*
Save the .htaccess file and then refresh your webpage. Now Gzip compression is enabled on your webhost . Check to see if your compression is working using the Gzip compression tool.