Need for Speed – Enable HTTP Compression
Uncategorized

Need for Speed – Enable HTTP Compression

20th April 2010

Since Google mentioned that site speed is now a factor, albeit a smaller one than relevance, SEOs need to look at ways of increasing site load speed. As web professionals we should already be obsessed with site speed as a quick loading site is a first positive impression and one that affects conversion and bounce rate.

One quick win is HTTP compression. Since the majority of the Google crawl is the underyling html, http compression allows significant improvements to be made for both googlebot and the user. Googlebot supports HTTP 1.1 compression.

For a test in mid March, after the SES speed rumblings, I decided to implement http compression to optimise a South African site, Sustainable.co.za. South Africa is probably one of the best places to test as the majority of the country has far slower connection speeds than Europe.  It was very easy to implement as I’ll detail a little lower but first I’ll share some of the data from webmaster central and Google analytics to illustrate the effect that such a small change can make:

  • Average time on site increased from 4:43 to 5:52
  • Average pages per view increased from 4.76 to 5.92
  • Conversion rate has gone from 5.17% to 8.34%

WMC Crawl Stats

Site performance in WMC

From my perspective it was a massively quick win, and has really affected the bottom line of that business. Http compression can sound a little daunting but it’s really quite easy to implement:

IIS

If you have access to RDC into the server you can enable it with a few clicks of a mouse. Right click my computer > manage then right click websites and the screen below will appear.

Click the service tab and then click dynamic and static content compression and you’re done.

Apache

You can set http compression in your htaccess file, while im no linux guru it was fairly simple, all I needed to do was uncomment a few lines illustrated below:

<IfModule mod_deflate.c>
############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip
# Insert filter on all content
###SetOutputFilter DEFLATE
# Insert filter on selected content types only
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>

That’s all I needed to do. I am no apache genius so if you know of a better way please feel free to comment below.

Testing your compression

http://www.whatsmyip.org/http_compression/ is a great tool for testing your http compression. I acheived an 81% savings in bandwidth.

What you do need to realise however is that it is a tradeoff and that http compression isn’t free, it does suck processor usage so make sure youre monitoring the performance of the website after you have enabled compression, keep your eye on webmaster central crawl stats and reap your rewards!

Tags

Written By
Louis Venter is the founding director and CEO of MediaVision, a Search Engine Marketing (SEM) company specialising in all areas of search. His particular interests are organic search marketing, paid search marketing, conversion strategy and online PR.
  • This field is for validation purposes and should be left unchanged.