5

I've got a number of websites on a single IIS7 machine running W2K8.

I'm using Fiddler to help me figure out if something is compressed or not. Nothing is.

So, I've googled for a few things and tried some things out. I have the following ...

C:\Windows\System32\inetsrv>appcmd set config -section:urlCompression /doDynamic
Compression:true
Applied configuration changes to section "system.webServer/urlCompression" for "
MACHINE/WEBROOT/APPHOST" at configuration commit path "MACHINE/WEBROOT/APPHOST"

C:\Windows\System32\inetsrv>appcmd list config -section:urlCompression
<system.webServer>
  <urlCompression doDynamicCompression="true" />
</system.webServer>

C:\Windows\System32\inetsrv>appcmd list config -section:serverRuntime
<system.webServer>
  <serverRuntime frequentHitThreshold="1" />
</system.webServer>

I've made sure that the urlCompression, httpCompression and serverRuntime sections are unlocked.

I've also added the following to my web.config :-

<system.webServer>
    <serverRuntime frequentHitThreshold="1" frequentHitTimePeriod="00:10:00" />
    <!-- NOTE: This requires the following section to be unlocked: appcmd set config -section:urlCompression /doDynamicCompression:true -->
    <urlCompression doDynamicCompression="true" dynamicCompressionBeforeCache="true" />
    <httpCompression noCompressionForHttp10="False" noCompressionForProxies="False">
        <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" dynamicCompressionLevel="4" staticCompressionLevel="9" />
        <dynamicTypes>
            <clear />
            <add mimeType="*/*" enabled="true" />
        </dynamicTypes>
        <staticTypes>
            <clear />
            <add mimeType="*/*" enabled="true" />
        </staticTypes>
    </httpCompression>
    <caching>
        <profiles>
            <add extension=".css" policy="CacheUntilChange" kernelCachePolicy="DontCache" duration="07:00:00" location="Any" />
            <add extension=".js" policy="CacheUntilChange" kernelCachePolicy="DontCache" duration="07:00:00" location="Any" />
            <add extension=".png" policy="CacheUntilChange" kernelCachePolicy="DontCache" duration="07:00:00" location="Any" />
            <add extension=".jpg" policy="CacheUntilChange" kernelCachePolicy="DontCache" duration="07:00:00" location="Any" />
            <add extension=".jpeg" policy="CacheUntilChange" kernelCachePolicy="DontCache" duration="07:00:00" location="Any" />
            <add extension=".gif" policy="CacheUntilChange" kernelCachePolicy="DontCache" duration="07:00:00" location="Any" />
            <add extension=".zip" policy="CacheUntilChange" kernelCachePolicy="DontCache" duration="07:00:00" location="Any" />
            <add extension=".htm" policy="CacheUntilChange" kernelCachePolicy="DontCache" duration="07:00:00" location="Any" />
        </profiles>
    </caching>
    <staticContent>
        <clientCache cacheControlMaxAge="31.00:00:00" cacheControlMode="UseMaxAge" />
    </staticContent>
....
</system.webServer>

So checking this, i'm not sure what i've done wrong ... ??? any suggestions? how can i debug this to see what's not getting read it right, etc?

I've also been doing 'force-refresh' when I grab the website content, etc. Definately not getting server-compressed :(

Please help!

Update 1: Browser request does include an Accept-Encoding: gzip, deflate .

Mark Henderson
  • 68,316
  • 31
  • 175
  • 255
Pure.Krome
  • 6,338
  • 17
  • 72
  • 86
  • Please see my answer to this question. It may help: http://serverfault.com/questions/505788/why-is-gzip-compression-varying-in-efficiency-in-iis – ianbeks Jul 23 '14 at 09:30

2 Answers2

3

For basics:

Check the browser is actually sending the Accept-Encoding header and its not being stripped by firewalls.

Enable Failed Request Tracing on response 200 and Web Server Compression and see what it says when IIS7 tries to compress the response.

Tornal
  • 131
  • 2
  • Browser is definately sending the Accept-Encoding: gzip, deflate (for both options). Can you provide more infor for the failed request tracing, please? – Pure.Krome Oct 07 '09 at 22:49
  • Read up on this tutorial. On Step 4 choose respone of 200 and on step 5 check "WWW Server" and "Compression" Checkbox. Then follow the analyse steps. Hopefully if applying compression fails it should point you in the direction of why. – Tornal Oct 08 '09 at 11:33
  • Yea, I screwed up the link but its in there – Tornal Oct 08 '09 at 11:34
1

You're not using HTTP 1.0 in your testing are you? The noCompressionForHTTP10="False" will prevent that from working.

What I suggest is to start over again and get compression working with the defaults, then add back the parts until it breaks again. Here's a default on a fresh install:

 <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
    <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
    <dynamicTypes>
       <add mimeType="text/*" enabled="true" />
       <add mimeType="message/*" enabled="true" />
       <add mimeType="application/x-javascript" enabled="true" />
       <add mimeType="*/*" enabled="false" />
    </dynamicTypes>
    <staticTypes>
       <add mimeType="text/*" enabled="true" />
       <add mimeType="message/*" enabled="true" />
       <add mimeType="application/javascript" enabled="true" />
       <add mimeType="*/*" enabled="false" />
    </staticTypes>
  </httpCompression>
Scott Forsyth
  • 16,339
  • 3
  • 36
  • 55
  • How will the noCompressionForHTTP10="False" will prevent that from working? By setting that to false, you're telling it to compress for 1.0 .. ??? – Pure.Krome Oct 09 '09 at 10:07