• June


  • 411
  • 0

Enable gzip compression to speed up web site

Enabling gzip compression of your HTML and CSS files will typically saves around 50 to 70 percent of the file size. This means that it takes less time to load your pages, and it also means less bandwidth is used over all. It is pretty much the standard now and if you are not using it for some reason, your webpages are slower than your competitors.

Google also takes into account page load times for page rank.

Compression is enabled by adding some code to a file called .htaccess on your web host/server. This means going to the file manager (or wherever you go to add or upload files) on your webhost. The .htaccess file controls many important things for your site.

If you are not comfortable with changing the .htaccess file you can look-up tutorials online or if you know someone that develops web sites you can contact him or her.

The code below should be added to your .htaccess file…


<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.*


Save the .htaccess file and then refresh your webpage.

Check to see if your compression is working using the Gzip compression tool.


Your comment will be published within 24 hours.

Copyright © 2001-2022 Rob Ellis. All rights reserved