Compressing ASPX pages with IIS

GZip / DEFLATE compression's a quick and simple trick you can employ to reduce the size of your pages that get sent down the wire. IIS supports this natively (IIS5 & IIS6, the latter improving the process somewhat). The best part is that it's quick simple to get up and running.

Jump onto the box you run IIS in as admin, open up a new cmd, and punch away the following:

go to your InetPub\adminscripts directory

net stop iisadmin   //To stop the services

cscript adsutil.vbs set W3Svc/Filters/Compression/GZIP/HcScriptFileExtensions  "aspx" "asp" "dll"  //Register the additional types to compress

net start w3svc   //Start the services back up

This sort of technology has been around for a while, so only users running on the most outdated browsers might have a few issues. But for the rest of us, compression can significantly reduce download times. For instance a Reporting Services report would come down as 500KB uncompressed, but only 50KB when compressed with GZip. That's 10% of the original.

That's quite significant when you're looking at slow connections, and the additional CPU load/time to compress is irrelevant when compared to savings in the download time side of things.

A quick side note is that there's hardly any difference between GZip and DEFLATE compression technologies. They'll both give you pretty much the same ratio's, but from memory DEFLATE contains a number of additional header fields, hence will be a number of bytes larger than its GZip counterpart.

posted @ Tuesday, January 22, 2008 12:58 PM

Print

Comments on this entry:

# re: Compressing ASPX pages with IIS

Left by Phil at 6/13/2008 5:18 AM
Gravatar
can this be done with an individual site like described at http://blog.grushin.com/2008/04/22/iis6-compression-other-tidbits/

Your comment:



 (will not be displayed)


 
 
 
Please add 4 and 5 and type the answer here:
 

Live Comment Preview:

 
«December»
SunMonTueWedThuFriSat
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910