Step-by-Step: HTTP File Compression in IIS 5.0
March 13, 2002


This article is for those of you running IIS on Windows 2000 Server or Advanced Server.  The version of IIS in Windows 2000 Professional does not include HTTP compression.

For those of us who run webservers from home on DSL or cable modem, bandwidth is a precious thing.  Most of us have very low upstream bandwidth which causes problems when our sites get busy.  One solution is to pay more money and get more upstream bandwidth.  Another solution is to compress the web files before they get shipped over the Internet.  Once the files reach the client's computer, they are decompressed by the client's computer.  However, nothing is ever free and there is a downside to file compression.  First, your server will have to spend cpu time to compress the files before they get sent.  Second, your visitor's computer will have to spend time decompressing the files.  Most likely, these two factors won't be much of a problem since the amount of cpu time required is fairly low.  Also, a good number of websites you visit on a daily basis already have file compression enabled.  This is possible be cause the decompression is built right into most modern web browsers.

If your DSL/Cable line is getting a bit slow, the HTTP file compression might be a partial answer to your problems.

HTTP Compression is enabled on a server basis which means that if you have multiple sites running on a single IIS 5.0 Web server, HTTP Compression will be running for all the sites. There is no option to have only certain sites compressed and other sites not compressed.

Start -> Programs -> Administrative Tools -> Internet Services Manager.

From the Internet Services Manager, right-click the Computer icon, and select Properties. 

On the Internet Information Services tab, under Master Properties, select WWW Service. Click Edit, the WWW Service Master Properties property sheet should appear.

Select the Service tab. 

To compress static files for transmission to compression-enabled clients, select Compress static files. Selecting this option compresses and caches files with the extensions "htm," "html," and "txt." 

Type the path to a local directory in the Temporary folder text box, or use the Browse button to locate a directory where the compressed files will be kept. I created a directory called "Compress" right under "Inetpub" to hold my compressed files.

Important: The directory you choose in Step 6 must be on a drive that is local to the Web server, and it must be on an NTFS (New Technology File System) partition. The directory, which should not be shared, cannot be a compressed directory or on a compressed volume. For more information on NTFS, search for the keyword "NTFS" in the Windows 2000 online help. 

To compress the dynamic output from applications for transmission to compression-enabled clients, select Compress application files. Selecting this option compresses and the dynamic output from applications with the file extensions "dll," "asp," and "exe." 

Important: Compressing the output of application files is not recommended unless many clients will be accessing your server over a slow connection, such as a modem. Also, ensure that your Web server has the processor power to handle re-compressing dynamic files each time they are requested by a client before enabling Compress application files. 

To limit the maximum temporary folder size, select Limited to, and type a whole number in the MB field. 

By default, maximum temporary folder size is set to unlimited. This works fine for Web servers with enough hard-disk storage for both the un-compressed version, in addition to the compressed version of static files stored in the temporary folder. 

However, if running short of disk space is a concern, then select Limited to. When the maximum temporary folder size is reached as configured by the MB field, IIS will delete 256 files to make room for new compressed files to be cached to the temporary folder. Configuring a temporary folder size too small can have an impact on performance because IIS will need to re-compress and re-cache static files, resulting in more CPU usage and hard drive access time. 

Click "OK" and you're done!
 



Step by Step Menu

Additional Information
Reference: