7

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.

3 Answers 3

9

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?

2
  • That could be related, but why does the gzipped file disappear after 5 minutes? Mar 5, 2010 at 1:13
  • frankadelic: I have set same in my web config. but gzip is disable after 2 or 3 request. Dec 15, 2012 at 6:05
1

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.

3
  • Can Combres be used without using <%= %> syntax in ASPX pages? For my solution, I have pages with CompilationMode="Never" so these tags will not work for me. Feb 5, 2010 at 15:52
  • No, this would not work. In this case I'd probably go for minifying / gzipping / packing all resources into one file myself and link it statically. Feb 5, 2010 at 16:07
  • Combres looks cool... maybe a future version will support Expression Builder syntax. Mar 12, 2010 at 4:54
-1

I would suggest you to pay attention on another software—Helicon Ape http://www.helicontech.com/ape It’s free for 3 web-sites and includes compression/caching solutions which work smoothly. Just in one string of configuration you will get gzip and cache enabled:

SetEnvIfNoCase mime text/.* gzip=9 cache-enable=mem

The rule above tells Ape to compress text/* mime-types with the highest level as well as cache them in memory. Just give it a try.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.