Enabling HTTP Compression With ASPX

Please note that this post was migrated to my new blog platform. There may be bad formating, broken links, images, downloads and so on. If you need an item on this page, please contact me and I will do my best to get it from my backups.

~E

Here’s a quick-n-easy post about enabling HTTP Compression on your server, as I’ve done over the weekend.  But instead of reading endless blog posts about it, and MSDN articles about enabling each and every step, I’ve compiled it all into a single CMD script you can copy and run on your server.  Easy.

First a tiny bit of background…  Yeah, I am so late to this game.  For a while I heard the buzz word, but only thought it was similar to Analog Modem compression (back when I worked for Hayes) to where both modems must support a common compression algorythm, which was mostly never the case.  Hence the “Call these sets of numbers if you have a USR, call this number if you have a Hayes modem, etc” you may remember back in the modem days.

After reading up on HTTP Compression here this weekend, boy have I missed the boat.  I’ve enabled it on my server over the weekend, over most dynamic file types, and it’s really picking up speed now (page loads seem faster).  I also found a nifty HTTP Compression Test website, that ensured me I finally got it enabled (it was a PITA for additional extensions).

Now the problem I had with HTTP Compression was the default list of extensions are very limited.  And it only does asp for dynamic content?  In IIE6?  You’d think they would default to aspx and asp.

Note that you will need to enable HTTP Compresison first, before running the attached script.  Instructions can be found here and just read the Procedures part. Don’t worry about running the scripts in that article as the attachment takes care of that, and additional extensions.

The attached script enables static and dynamic compression types as listed below.  They are as follows:

Dynamic Types: ASP, DLL, EXE, ASPX, ASCX, ASMX, ASHX

Static Types: HTM, HTML, TXT, PPT, XLS, XML, PDF, XSLT, DOC, XSL, HTC, JS, CSS

You’ll notice a few up for debate in that list, such as ASCX and PDF.  The debates ranged all over the web and saw it as an advantage more then disadvantage.  So over the next few weeks, I ask those I am hosting on my server to see if any dynamic content isn’t so dynamic.  Kind of like a passive-monitoring approach by asking my users to see if they notice any difference.

About the PDF, some websites generate dynamic PDF content.  But usually it’s just encoded as a PDF MIME-TYPE, and doesn’t actually have the extension of PDF.  IIS6’s HTTP Compression is based off of extensions, not the mime-type.  So I classified it as static.

A little script support.  First, this script assumes your OS is installed on C:.  And it assumes you have the file adsutil.vbs located at C:\InetPub\AdminScripts\ (default location).  If different locations, you can edit the script file as need be.  Besides that, you must be running at least W2K3 or R2 and as mentioned above already have HTTP Compression enabled.  Haven’t tested this yet on IIS7 (Longhorn) yet.

Enabling HTTP Compression with ASPX

 

> Revision History
> About the author