Tag Archives: compression

Improve page speed with GZIP compression

gzip

Still on the topic of improving your website’s load speed, ensuring that files requested are served as compressed (zipped) files is an easy way of gaining large savings on load speed. Yes, it is true that the older browsers are not able to handle compressed files, but in terms of the modern internet, those are very old browsers such as IE 4.0 on Windows 95. Most website visitors have moved on from there by now.

So how does one compress your website files? There are various ways, but probably the easiest for most webmasters is this simple method:

1. Make sure that compression is enabled on the server settings (ask the ISP if you are not in control of the web server).

2. Add the following code to the .htaccess file for your website:

# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

There is an excellent explanation of how it all works in this article:
How To Optimize Your Site With GZIP Compression