Faster! Curious how we did it?
The redesign of my site was partially vanity, and partially SEO. Now, when we say SEO, we do not mean cultivating back links from random sites, jockeying with keywords that have nothing to do with us, or randomly finding blogs to comment on just so we can get a link to our site in their comment area.
Our SEO undertaking was all about organization, and speed. We’re going to take each thing we did piece by piece and share it with you.
Today, we’re going to talk about compressing your site.
Let out some hot air
Mod-deflate is an optional module for the Apache HTTP Server, Apache v2 only. Based on Deflate lossless data compression algorithm that uses a combination of the LZ77 algorithm and Huffman coding. This module provides the DEFLATE output filter that allows output from Apache HTTP server to be compressed before being sent to the client over the network. (Lifted word for word from http://en.wikipedia.org/wiki/Mod_deflate)
It takes your files, squishes them, hands them over to your visitors squished, and your visitor’s browser (if its a modern browser) unsquishes them so they can view the page. This will save your bandwidth, and your visitor’s loading time making your site faster. It does this by trading off resources, as the act of the server squish takes more of the server’s CPU than normal.
Any of you currently using mod-deflate?
If your site currently rates well with regard to speed, you may not need to worry about mod-deflate. You are going to trade off CPU usage, and we do have a ceiling on that so you should think carefully about how busy your site is, and whether you think that you can afford the CPU hit on your account. On the other hand, if your site is one that is competing for the race up the Google rank or you have a serious concern about having the absolute best possible experience for your visitors with regard to speed, this is something you may want to implement.
And implementing it is pretty much a snap. While it runs on all servers right now, it won’t compress anything until you tell it to on your individual site, and the way that you give it marching orders is through .htaccess. Here’s ours:
# compress certain file types by extension: <FilesMatch "\\.(js|css|html|htm|php|xml)$"> SetOutputFilter DEFLATE </FilesMatch> #exempt old browsers BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0 no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Again, the warning is that this will up the CPU cost of serving the pages while lowering the bandwidth and speeding up the page. How high the CPU cost will be will depend on the size of your pages, and your traffic.
If your website’s implementation causes a problem, we will definitely contact you and let you know. You can also implement it, and email support to ask us to look up your site’s daily average resource usage for the days proceeding your implementation and the days during its usage, and we’ll be happy to tell you so you have an idea.