views:

330

answers:

2

I'm having issues with IIS7's static compression. I've read some of the other posts, and I'm out of options. Here's what I have:

In the applicationHost.config, I've set up:

    <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files" staticCompressionDisableCpuUsage="100">
        <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" staticCompressionLevel="9" />
        <staticTypes>
            <add mimeType="text/*" enabled="true" />
            <add mimeType="message/*" enabled="true" />
            <add mimeType="application/x-javascript" enabled="true" />
            <add mimeType="*/*" enabled="true" />
        </staticTypes>
    </httpCompression>

The "enable static compression" checkbox is enabled for my site.

I get a big fat uncompressed file when I load up the site. If I look at the request headers, I see:

Accept-Encoding : gzip,deflate

but, in the response, I get:

Content-Type: application/x-javascript

Last-Modified: Fri, 10 Jul 2009 01:13:41 GMT

Accept-Ranges: bytes

Etag: "3be6da9fb0ca1:0"

Server: Microsoft-IIS/7.0

X-Powered-By: UrlRewriter.NET 2.0.0, ASP.NET

Date: Fri, 10 Jul 2009 03:39:35 GMT

Content-Length: 81515

Anyone have any ideas what I'm doing wrong here?

Also, FWIW, I'm running in Integrated, not "Classic" mode.

UPDATE: I got it working, but I'm not sure why it works now. All I did was enable dynamic compression for the site, and everything started working. Anyone have any thoughts?

A: 

I'm not that good in IIS7 compression but I want to advise you to have a look at Helicon Ape mod-gzip module that provides comprehensive compression capabilities. The guide on how to enable and use Helicon Ape mod-gzip is here.

TonyCool
Isn't it weird how all your answers recommend Helicon products. I wonder why.
blowdart
Why can't I advise a tool I enjoy to people who may also benefit from using it? I'm not advertising it but just sharing my experience.
TonyCool
Uh-huh. And yet every answer you've given on Stack Overflow has recommended a Helicon tool. Your marketing attempts are very transparent.
blowdart
If you check my answers once again you'll see that not all of them refer to Helicon products. I did advise it a couple of times, but don't you think it was relevant in that cases. I'm not trying to put Helicon link anywhere possible, 'cause that's not my goal (I'm not at all a marketer).
TonyCool
A: 

I got it working, but I'm not sure why it works now. All I did was enable dynamic compression for the site, and everything started working. If someone can give me an explanation for why this worked, I'll give them credit on the answer.

jvenema
Are you sure your page was static? Sounds like it was a dynamic page, to me.
pduncan
It was a plain js script...doesn't get much more static than that :)
jvenema