user1056038
user1056038

Reputation: 63

IIS6: setting up gzip compression for cfm/js/css files

I'm new to IIS. In short, I'm facing issues to set up the gzip http compression for "cfm js css" file types in IIS6.

The reference resource I followed is at: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/502ef631-3695-4616-b268-cbe7cf1351ce.mspx?mfr=true

Here are the exact steps I did:

  1. In IIS Manager, double-click the local computer, right-click the Web Sites folder, and then click Properties.
  2. Click the Service tab, and in the HTTP compression section, select the Compress application files check box to enable compression for dynamic files.
  3. Select the Compress static files check box to enable compression for static files.
  4. Change the 'Temporary directory:' to 'C:\Inetpub\compressed_static_files'.
  5. Under Maximum temporary directory size, click 'Unlimited' radio button.
  6. Click 'Apply' button and then click 'OK'.

However, these settings are for .htm, .html, .txt and .asp, .exe and .dll file type only. So, in order to add .js, .css and .cfm, I ran the following commands according to the instruction at the url: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/5bce429d-c4a7-4f9e-a619-5972497b932a.mspx?mfr=true

Exact steps are:

cd c:\Inetpub\AdminScripts
cscript adsutil.vbs SET W3SVC/Filters/Compression/Deflate/HcFileExtensions "htm html txt js css" 
cscript adsutil.vbs SET W3SVC/Filters/Compression/gzip/HcFileExtensions "htm html txt js css"
cscript adsutil.vbs SET W3SVC/Filters/Compression/Deflate/HcScriptFileExtensions "asp dll exe cfm"
cscript adsutil.vbs SET W3SVC/Filters/Compression/gzip/HcScriptFileExtensions "asp dll exe cfm"

To activate this, I restarted IIS. Steps I followed are:

  1. In IIS Manager, right-click my local computer and select 'All Tasks > Restart IIS...'.
  2. Select 'Restart Internet Services on ' and click OK.
  3. Click 'End now'.

At this point, the server is restarted and now I tested whether the http compression is working or not with the following steps:

  1. Open my web site in FireFox and go to any page with .cfm extension.
  2. Open up FireBug.
  3. Check 'GET' Request Headers for .cfm file. I saw 'Accept-Encoding: gzip, deflate'. This is what the browser sends to the server.
  4. Now, check 'GET' Response Headers for .cfm file. There is even no 'Content-Encoding:' header. I am supposed to see 'Content-Encoding: gzip' here to confirm the server sent .cfm file as gzip encoding.

The same case for 'js css' and even 'html' file too. I think it must be some very basic thing I'm missing here. It will be great if anyone could give me a hint on this.

Thanks in advance. Gen

Upvotes: 0

Views: 4215

Answers (2)

TimDawe
TimDawe

Reputation: 341

Not much help to the OP, over 2 years after the question was asked, but for the benefit of anyone else finding this in Google (as I did), the problem here is with the syntax.

cscript adsutil.vbs SET W3SVC/Filters/Compression/Deflate/HcFileExtensions "htm html txt js css"

should be

cscript adsutil.vbs SET W3SVC/Filters/Compression/Deflate/HcFileExtensions "htm" "html" "txt" "js" "css"

Note the quotes are around each item in the list, not the whole list

Upvotes: 3

Andy Davies
Andy Davies

Reputation: 5824

On IIS6 I always do it by editing the meta-base directly.

You'll have to check the setting on the web-server properties to be able to do this and be sure to make a backup of the meta-base first e.g. check it in to your source repository

Jeff Atwood covers it here: http://www.codinghorror.com/blog/2004/08/http-compression-and-iis-6-0.html

Upvotes: 1

Related Questions