HTTP Compression : Smaller, Faster… Better

Posted: August 17th, 2009
Filed under: IIS & HTTP, Web Speed and Performance
Tags: , , , ,

What is HTTP compression and how does it work?

HTTP compression is a long-established Web standard in which a GZip or Deflate encoding method is applied to the payload of an HTTP response, significantly compressing the resource before it is transported across the Web.

When data is encoded using a compressed format like GZip or Deflate, it introduces complexity into the HTTP request/response interaction by necessitating a type of content negotiation. Whenever compression is applied, it creates two versions of a resource:

  • One compressed (for browsers that can handle compressed data)
  • One uncompressed (for browsers that cannot)

A browser needs only to accurately request which version it would like to receive.

Most often, HTTP compression is implemented on the server side as a filter or module which applies the GZip algorithm to responses as the server sends them out. Any text-based content can be compressed. In the case of purely static content, such as markup, style sheets, and JavaScript, it is usually possible to cache the compressed representation, sparing the CPU of the burden of repeatedly compressing the same file.

Compression results in significant file size savings on text-type files. The exact percentage saved will depend on the degree of redundancy or repetition in the character sequences in the file, but in many cases, individual files may be reduced by 70 or even 80 percent.

~ Port80

No Comments »

Leave a Reply