How To: HTTP Compression in IIS 6.0
Source: The .NET Guy’s Web log
1. Allow the compression ISAPI to run
IIS 6's new security system prohibits ISAPI DLLs from running by default, so you need to tell IIS 6 that it's okay to let the compression ISAPI DLL run.
01. Open the IIS admin tool (inetmgr); drill into your server, and right-click on "Web Service Extensions".
02. Choose "Add a new web service extension". For the extension name, use whatever you want to identify it in the list (I used "HTTP Compression Extension").
03. You need to add a single required file, which is \Windows\System32\inetsrv\gzip.dll, the ISAPI responsible for doing gzip and deflate compression.
04. Check the "Set extension status to allowed", then click OK.
05. You should have a new web service extension in your list called "HTTP Compression" (or whatever you named it), and it should have a status of "Allowed".
2. Select compressible content
IIS 6's compression system only compresses a very limited set of content. You need to enable compression for the appropriate file extensions (specifically, .aspx files for your ASP.NET pages, and perhaps any static content you want compressed as well).
01. You're going to edit the Metabase. To do this, you first need to shut down IIS.
02. In the IIS admin tool, right click on your server name in the left panel, and choose All Tasks -> Restart IIS.
03. On the restart dialog, choose "Stop internet services" and click OK. When IIS is shut down, you'll need to edit \Windows\System32\inetsrv\MetaBase.xml (make a backup first!).
04. Search for "IIsCompressionScheme". There will be two XML elements, one for deflate and one for gzip. Both elements have properties called HcFileExtensions and HcScriptFileExtensions. These contain a space-delimited list of file extension for compressible content.
05. At a bare minimum, you'll need to add “aspx”, “ascx” to the HcScriptFileExtensions list. Note that if the properties are left blank, then all content, regardless of file extension, will be compressed.
1. Make sure that IIS process user account has required privileges on the compression temp folder.
2. Do never try to compress image types (jpg, gif, png, tiff etc…)