小编dav*_*dcl的帖子

如何启用 iis 7 动态内容压缩?

我在 IIS 7 中打开了动态内容压缩,但是 Fiddler 显示我的动态页面仍然在没有内容编码的情况下提供:gzip。

静态内容压缩在相同的服务器上运行良好。

不确定这是否重要,但大多数动态页面都是 Coldfusion 页面(Coldfusion 被配置为 ISAPI 扩展),我们也在使用 IIS URL 重写模块。

这是来自我的 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" />
Run Code Online (Sandbox Code Playgroud)

这是一个示例请求:

GET / HTTP/1.1
Host: web5.example.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT …
Run Code Online (Sandbox Code Playgroud)

iis compression iis-7 gzip

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

compression ×1

gzip ×1

iis ×1

iis-7 ×1