Backwards Content Compression

You don’t see it nearly as much as you should, but some web developers and server administrators are intelligent enough to put a compression filter (or module) in front of their web servers. When a browser that supports compression, the filter / module kicks in, and compresses the HTML, Image, Video, Flash or whatever is being fetched. The compression means that the file moves over the wire faster. Or at least thats the theory.

The fact is that for some instances (generated HTML code for example), the effort of compressing the file is more than it’s worth. In other instances (large images, or any static content for that matter), compression can make a huge difference. So I’ve started working with the idea of “Backward Compression”. The files are stored as “GZIP” files on the disk, if a browser that does not support compression requests the file, my filter decompresses it and sends it to the client. This has several advantages over compressing the files:

  • Most browsers support compression, so the file can be sent as is
  • GZIP decompression is cheaper than compression
    • Less effort is expended by decompressing for the browsers that don’t support GZIP
  • You can decide up front what should be compressed and what shouldn’t
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: