How to setup GZip Compression in IIS
Posted: Tue Dec 22, 2009 2:23 am
By using compression for static web files will make faster downloads for the users. IIS can gzip on javascript and css files.
- Enable HTTP Compression
- Open IIS Manager
- Right-click "Web Site" and select "Services" tab.
- Check "Compress Static Files"
- Click "Ok"
- Specify that "js" and "css" file should be compressed by changing the metabase. By default, IIS 6.0 is set up to compress htm, html, and txt files.
- Open a command prompt
- cd to C:\Inetpub\AdminScripts (assuming the default location)
- run this command (you can change the list of extensions, but only specify static, compressible files here):
Code: Select all
cscript.exe adsutil.vbs set w3svc/Filters/Compression/GZIP/HcFileExtensions "htm" "html" "txt" "js" "css"
- Restart the World Wide Web Publishing Service