Go back to the Delta Guide Home Page. Download this article as a PDF file.

A020502

Understanding Compression

One of the problems with bandwidth is that a lot of the Web traffic that passes by on the Internet is based on flat text files—the HTML and generated HTML—that make up the pages of a site. This creates a number of problems, starting with the amount of bandwidth used by your Web site when browsed by others on the Internet.

It also directly affects the bandwidth of your own connection to the Internet. You can reduce your bandwidth requirements by compressing the data that you send from Web servers. Because the data is compressed, it takes less time to transfer, and therefore requires less bandwidth. The CPU requirement for decompressing at the client is minimal.

The only down side to using compression on your Web servers is that it increases the load on your CPU because each static file and dynamically generated component has to be compressed. To help reduce the effects, static files are compressed and stored in their compressed format within a cache—with the compressed version returned from the cache automatically.

How HTTP Compression Works

When a browser connects to a Web server, as part of the conversation that takes place before the client requests a page, the browser will announce its capabilities in the HTTP 'header' of information sent to the server. Part of this information includes whether the client supports different compression algorithms. If the client doesn't support compression, the information is sent back as raw data with no compression.

If the client does support compression, IIS checks the extension. If the file is static and exists in the compression cache, the file is sent directly from the cache in its compressed form. If the file doesn't already exist in the cache, it's compressed and added to the cache—but no file is added until it has been requested.

If the request is for a dynamic component, the server will dynamically compress the response from the component before sending it to the client—without storing any information.

Enabling HTTP Compression

HTTP Compression in IIS 6 is enabled on an entire server. To set it up, follow these steps:

  1. Right-click on the Web Sites within IIS Manager and select Properties.

  2. Change to the Service tab. Under HTTP compression, select the Compress Application Files check box to compress dynamic responses and/or the Compress Static Files check box to compress static files.

  3. In the Temporary Directory, enter the path to the directory that you want to use for storing compressed static components. If available, use a directory located on a fast drive or RAID array for the best performance.

  4. Select whether you want to use an unlimited amount of space to store the compressed files, or a limited amount. If you choose limited, you must specify the number of megabytes you want to reserve. If unlimited, IIS will carry on writing compressed files to the folder you select until the disk is full. You should expect to reserve approximately 75% of the disk space for your site for the compressed versions of the files. In reality, the usage might well be much lower than this.

  5. Click OK to accept the changes.


Go back to the Delta Guide Home Page. Download this article as a PDF file.