Iis – Why is IIS7 not compressing the static files

compressiongzipiisiis-7

I am trying to get IIS to compress jquery.js (and all other static files, but using jquery as the example here) on my localhost, but something goes wrong.

The funny part is that when I look in my %SystemDrive%\inetpub\temp\IIS Temporary Compressed Files\MySiteName, I see the jquery.js file there, and its size is 24 KB. But in the browser, according to the Net tab on Firebug, the size is 69 kb.

I've tried the following:
– Checked that my browser accept compression. I found "Accept-Encoding gzip, deflate" in the request header via Firebug
– Enabling Failed Request Tracing. Nothing turns up in the %SystemDrive%\inetpub\logs\FailedReqLogFiles folder after I do my request though.

Best Answer

I noticed that in my Failed Request Log (which I had to set up a rule in that made sure it logged successful requests) the jquery file compression was not a success with the error code NOT_FREQUENTLY_HIT. So I tried making a bunch of requests manually by refreshing the browser and all of a sudden the jquery file had been compressed.