IIS6 HTTP Compression in four quick and easy steps

1. To enable HTTP Compression in IIS6 for all websites, open the IIS Manager, goto Properties of "Web Sites" and select the "Service" tab. Check the "Compress application files" and "Compress static files", and specify a location for the temp cache dir (if you want to). Maximum dir size is usually set to 1000MBs. Click "OK".

2. Then right-click on "Web Service Extensions" and add a new Web Service. Name it something like "HTTP Compression" and add the file "C:\WINDOWS\system32\inetsrv\gzip.dll". Check the "Set extension status to Allowed". Press "OK".

3. Then right-click on your server (local computer) and goto Properties. Check the "Enable Direct Metabase Edit". Press "OK".

4. Run this small batch - IIS6HttpCompressionSettings.zip (Made by me). It will add several common file extensions to the MetaBase.xml list so that e.g. css, js, axd, etc are included in the compression. And it will set compression level to 9 (is suggested by several .Net gurus).

In short, the batch runs several of these commands to make the appropriate changes: cscript C:\Inetpub\AdminScripts\adsutil.vbs set /w3svc/filters/compression/gzip/HcFileExtensions "css" "xml" "htm" "txt"

Once you have run the batch, simply do an iisreset and you are finished.

Alternatively, If you want to change the MetaBase file manually open the file "C:\WINDOWS\system32\inetsrv\MetaBase.xml" and search for the "IIsCompressionScheme" xmlnode. In the first two nodes (deflate and gzip) change the HcDynamicCompressionLevel to 9. If you want compression of aspx files (most likely), then add "aspx" to the HcScriptFileExtensions in both xmlnodes. Be sure to follow the format that is already used (e.g. not inserting any blank spaces). Save the file and do an iisreset.

For more detailed explanation of the different steps please goto: http://weblogs.asp.net/owscott/archive/2004/01/12/57916.aspx For information about enable or disabling compression of a single website see more at Microsoft's Technet article on HTTP compression.

↓ Add Comment
↓ Add Comment

Comments (0)