Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In IIS7, gzipped files do not stay that way

I have configured IIS7 to gzip static content.

http://www.coderjournal.com/2008/04/iis-7-compress-javascript-gzip/

However, the files don't "stay" gzipped.

Here's my use case:

  1. Request test.css file. It is not gzipped.
  2. Request it again within a few seconds. It is gzipped.
  3. Wait 5 minutes.
  4. Request test.css file again. It is not gzipped.

This doesn't make sense -- shouldn't the gzipped version of a static file be delivered on all subsequent requests, if the original did not change?

Note: I am using Firefox and Firebug to verify gzipped content by checking the Content-Encoding header.

like image 686
frankadelic Avatar asked Feb 04 '10 22:02

frankadelic


2 Answers

According to this article:

Changes to compression in IIS7 by Kanwaljeet Singla

In IIS7, content is compressed depending on it's hit frequency which is configurable like this:

<system.webServer>
  <serverRuntime enabled="true"
    frequentHitThreshold="5"
    frequentHitTimePeriod="00:00:20" />
</system.webServer>

Maybe you're not hitting these thresholds?

like image 64
Kev Avatar answered Sep 24 '22 02:09

Kev


Depending on how badly you need to optimize performance on your site, you might want to use Combres instead.

The big advantage is that it does only only minify and gzip your javascript files, but it also combines all files into one, so there is only one http request for all your javascript files. In addition, it also makes use of client-side caching, so that the file is only downloaded when necessary. Also, it does the all this for CSS files as well.

It's quite easy to set up, so instead of trying to fix this, your time might be better spent on getting Combres instead.

like image 25
Adrian Grigore Avatar answered Sep 26 '22 02:09

Adrian Grigore