【发布时间】:2016-09-15 06:37:28
【问题描述】:
我查看了本网站上有关此问题的所有问题,但没有一个解决方案对我有用!我知道我一定错过了一些小东西,但我就是找不到。
我使用的是 Windows 7 和 IIS 7.5。所以我在系统中添加了以下内容applicationHost.config:
<section name="httpCompression" allowDefinition="MachineToApplication" overrideModeDefault="Allow" />
我已经安装了静态和动态压缩并为网站启用了它们。
并将以下内容添加到我的web.config
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files" >
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" doStaticCompression="true" />
<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="application/atom+xml" enabled="true" />
<add mimeType="application/xaml+xml" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
</httpCompression>
但它仍然不起作用。我尝试了 FailedReqLog 模块来调试这个问题,但没有创建日志文件。我什至在 IIS 的配置编辑器中都看不到 httpCompression。
过去 3 天我一直在尝试不同的解决方案。我完全没有想法。如果有办法跟踪此问题并查看为什么它可能不遵循 web.config 设置,则非常感谢调试选项。更糟糕的是为什么它没有在配置编辑器中显示。
【问题讨论】:
标签: c# asp.net windows iis gzip