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.

«January»
SunMonTueWedThuFriSat
303112345
6789101112
13141516171819
20212223242526
272829303112
3456789