3/4/2009 -- I'm running IIS 6.0 on Windows Server 2003. I can see the Service tab only on the Web Sites folder, not the individual Web sites, which means I can only enable static compression globally on all sites. How can I enable static compression on only one specific site?
Answer:
HTTP compression is enabled though the Service tab, which is only available on the Properties of the Web Sites folder (as you've discovered). You can compress either static or dynamic responses for your Web site, which speeds up Web site performance.
There are two options for you to select: "Compress application files" and "Compress static files." When you select the "Compress application files" option, you're configuring dynamic compression. When you select "Compress static files," you're configuring static compression.
Besides using the GUI, you can also enable static or dynamic compression by using the adsutil.vbs script. For static compression, use the following command at the command prompt:
cscript adsutil.vbs set w3svc/filters/compression/parameters/HcDoStaticCompression true
Replace the word "Static" in the above command with "Dynamic" for dynamic compression:
cscript adsutil.vbs set w3svc/filters/compression/parameters/HcDoDynamicCompression true
In your case, you're interested in enabling static compression for only one specific site, so you can first disable compression for all sites using the advsutil.vbs script. Then you can enable compression for just one site.
Log on as an Administrator account and type the following at the command prompt to disable static compression globally:
adsutil set w3svc/filters/compression/parameters/HcDoStaticCompression false
Now enable static compression only for your site by typing the following:
adsutil set w3svc/1/root/Home/mySite/DoStaticCompression true
Replace the path to mySite in the above command with the name of your site.
|