Notice: Undefined index: 8885611f2609f88b in /var/www/blog.morebrandwidth.com/index.php on line 1
Brandwidth Blog » Blog Archive » Server Side Compression Serving Up Bandwidth Savings

Server Side Compression Serving Up Bandwidth Savings

In the fun world of server administration, you come across some real gems sometimes. For the most part, I had been using the standard apache configuration to serve up sites. While this is perfectly acceptable, it can become quite a load on your internet connection when one hosts as many sites as we do. Enter Compressed output.

In trying to increase performance of our servers, we recently enabled the gzip compression module (mod_deflate) in Apache. This module will compress all of the text output of the server (HTML, CSS, Javascript), making sites load faster and cache better on the client side. This works especially well for sites that include large Javascript libraries (AJAX) or large CSS layouts.

There is a bit of configuration you need to do because not all clients can support gzipped content (mainly older browsers). In addition, it is a good idea to tell the server to only compress text based elements. Otherwise you will be wasting CPU cycles trying to compress highly compressed graphics and other components that don’t yield themselves to great compression rates.

Below is part of our server config (standing on the shoulders of giants here.. I found this on the net and modified it slightly):

##—- Deflate options
SetOutputFilter DEFLATE
DeflateCompressionLevel 9

## 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 \bMSI[E] !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#

The benchmark results were promising as well. For graphic intensive sites, we gained around 2-3 seconds on load time. For text intensive sites, we saw an increase of up to 5 seconds. When you spread these savings over multiple sites and multiple hits, these savings add up quickly.

To test your own sites, you’ll need two tools (three if you count Firefox). You’ll need to download and install Firebug and Yslow (for firebug). These two components will show you the load times, the cache footprint, and the compression rates for your site.

If you want to speed up your server or just more efficiently utilize your internet connection, Server Side compression is the way to go!

Leave a Reply

You must be logged in to post a comment.

videos of girls fucking BIG cocks PORN FREE VIDEOS hugeround ass milf exclusive mistress teen grils teen girl sex solo brazzers nyla knox facial Free porn www BBW BUSTY all natural viagra cheapest price cialis soft tabs cheapest price for generic viagra soft tabs does viagra work viagra cheap free levitra order online order cialis over internet need no doctor hardcore porn free porn teen xxx Mature Porn porn blog sex