6

How do I force IIS 7.X to do static compression regardless of how frequently the static file is accessed? If I refresh the page in Firefox with caching disabled, that is the only way it does the static compression because of some "Not Frequently Hit" condition which refuses to do the static compression unless the file is frequently accessed.....

More details: http://forums.iis.net/t/1162238.aspx

jjxtra
  • 20,415
  • 16
  • 100
  • 140
  • I ended up rolling my own custom compression for static and dynamic, and all is well. Never did figure this one out... – jjxtra Aug 24 '11 at 22:17

1 Answers1

6

Took me a while to figure this out too. Setting the frequentHitThreshold attribute to 1 on the system.webServer/serverRuntime node in the applicationHost.config file should do the trick, as documented at http://www.iis.net/ConfigReference/system.webServer/serverRuntime.

You can do this by executing the following command as an administrator:

%windir%\system32\inetsrv\appcmd set config /section:serverRuntime /frequentHitThreshold:1 /commit:apphost

A word of warning - the "frequent hit" concept does not seem specific to compression. I have no idea whether there are other consequences as a result of setting this!

Dale Anderson
  • 1,681
  • 16
  • 15