how to enable iis 7 dynamic content compression?

Posted by davidcl on Server Fault See other posts from Server Fault or by davidcl
Published on 2010-01-20T17:05:50Z Indexed on 2010/04/26 1:03 UTC
Read the original article Hit count: 692

Filed under:
|
|
|

I've turned on dynamic content compression in IIS 7, but Fiddler is showing that my dynamic pages are still being served without content-encoding: gzip.

Static content compression is working fine on the same servers.

Not sure if it matters but most of the dynamic pages are coldfusion pages and we're also using the IIS URL rewriting module.

This is from my applicationhost.config.

        <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/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>
...
        <urlCompression doDynamicCompression="true" />

Here's a sample request:

GET / HTTP/1.1
Host: web5.example.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive

and response header:

HTTP/1.1 200 OK
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
Server: Microsoft-IIS/7.0
...
Date: Mon, 22 Feb 2010 20:59:36 GMT

© Server Fault or respective owner

Related posts about iis7

Related posts about iis