One of our sites was loading pretty slow. This is mostly caused by a very heavy design. But i still wanted to speed things up a bit.
When the mod_deflate module is loaded in apache this is a pretty easy thing to do. Just add the following lines to a .htaccess file in the root of the web site / application.
- BrowserMatch ^Mozilla/4 gzip-only-text/html
- BrowserMatch ^Mozilla/4.0 no-gzip
- BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
The first line enables mod_deflate for the specified extensions. And the other three lines are there because of the way some older browsers handle gzipped data.
To test if the the content is transmitted over the line in gzipped format i used the Live HTTP Header Firefox extensions. This let’s you watch the Live HTTP headers as the fly by.
Check the HTTP/ 1.x 200 OK response from the webserver for the following line
And to test what happens if a browser doesn’t support gzipped data. You can set a configuration parameter in Firefox about:config.
gzip, deflate enabled:
network.http.accept-encoding = gzip,deflate
gzip, deflate disabled:
References : http://www.howtoforge.com/apache2_mod_deflate