IIS (6.0) Site level compression

Its a well known fact that Using HTTP Compression for Faster Downloads makes good sense. Also, if you have any problems getting this to work then Troubleshooting HTTP Compression in IIS6 is a good place to start.

This is just a little ‘note to self’ about using the IIS Metabase Explorer to configure your web server for compression, specifically at a site level. My situation arose because the IT guys didn’t want to apply compression across every site on the server, if it wasn’t necessary. I was using the Metabase Explorer to change my IIS settings and having configure the HcDoDynamicCompression, HcDoDynamicCompressionLevel and HcScriptFileExtensions records for defalte and gzip keys, I went to set the DoDynamicCompression record for the site.

After creating the DoDynamicCompression record on the root node for the site and changed the value to 1 (true) I went to check the response from the server. To my surprise the response still wasn’t being compressed. After a bit of head scratching I deleted the DoDynamicCompression record and then re-added it, this time using the adsutil IIS admin script. After checking the response and finding it was now compressed successfully I went back to the Metabase Explorer to see what was different.

For site level compression there are a couple of additional values that need setting for the DoDynamicCompression record:

  1. The User Type needs to be changed to File.
  2. The Attributes need to be set to Inheritable.

IIS (Express) 7.5, Hosts file and Authentication

I have been using IIS Express to do some of my recent development instead of using the ASP.NET Development Server so that I could use the additional functionality within IIS. (Personally, I hate developing with the ASP.NET Development server but I am having to develop on XP at the moment and IIS 5.1 is not much better. Getting IIS Express has been a real bonus.). I had configured my IIS site originally with a localhost address and Visual Studio debugging worked fine. Unfortunately, Fiddler doesn’t like monitoring localhost addresses so I created a new entry in my Hosts file to use localhost.

This created my second issue. When I tried to run my app within VS  I got the ‘Unable to start debugging on the Web server’ error, IISExpress was reporting 401 errors and all because of the entry in the Hosts file. So after the usual search to try and find similar problems I came across this MSDN KB article. I actually used Method 2 in the article and I didn’t need to reboot my machine, just restart my IISExpress instance. This solved my problem as Visual Studio was then happy to go through the authentication process and Fiddler was capturing my Requests/Responses.

IE Compatibility View

Having done some intensive research over the last couple of days to define exactly what happens when you set your IE browser to Compatibility View I thought it was worth noting a few things down.

  • IE uses Compatibility View to let website developers/administrators define how a website is displayed regardless of the version of IE being used. This is because MS are moving away from their bespoke CSS implementations, used for < IE7, to the more recognised W3C version.
  • The Compatibility View also affects the level of support applied to JavaScript code as functionality will change between versions of IE.
  • By default, any IE user running in the Local Intranet Security zone is automatically forced into Compatibility View. However, this option can be changed either by a user with sufficient permissions or Group Policy.
  • There is no way to programmatically stop users from running the site in Compatibility View. Adding the <meta> tag correctly disables the option from the Tools menu but the site can still be forced into Compatibility View either by:
    • Using the default Compatibility View settings and running in the Local Intranet security zone
    • Adding the site to the Compatibility View settings (this is a separate option to the Compatibility View switch in the Tools menu).

These are some of the useful links I have found whilst scouring the web for relevant information: