18

我目前配置了静态和动态压缩。静态压缩工作正常,但是通过 YSlow 和 Fiddler 检查动态压缩不工作。

在我的 applicationHost.config 中,我有以下设置:

<urlCompression doStaticCompression="true" doDynamicCompression="true"
    dynamicCompressionBeforeCache="true" />
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"
    maxDiskSpaceUsage="100" minFileSizeForComp="256">
    <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"
        dynamicCompressionLevel="1" />
    <dynamicTypes>
        <add mimeType="text/*" enabled="true" />
        <add mimeType="message/*" enabled="true" />
        <add mimeType="application/x-javascript" enabled="true" />
        <add mimeType="*/*" enabled="true" />
    </dynamicTypes>
    <staticTypes>
        <add mimeType="text/*" enabled="true" />
        <add mimeType="message/*" enabled="true" />
        <add mimeType="application/x-javascript" enabled="true" />
        <add mimeType="application/atom+xml" enabled="true" />
        <add mimeType="application/xaml+xml" enabled="true" />
        <add mimeType="*/*" enabled="true" />
    </staticTypes>
</httpCompression>
<serverRuntime frequentHitThreshold="1" frequentHitTimePeriod="01:00:00" />

我的 web.config 有:

<urlCompression doStaticCompression="true"
    doDynamicCompression="true" dynamicCompressionBeforeCache="true" />

模块已安装,当我使用失败的请求跟踪时,我得到了几个动态压缩命中,但没有关于成功或失败的信息。只是这些类型的结果:

ModuleName DynamicCompressionModule 
Notification 536870912 
fIsPostNotification false 
Notification SEND_RESPONSE 

ModuleName DynamicCompressionModule 
Notification 536870912 
fIsPostNotificationEvent false 
NotificationStatus 0 
Notification SEND_RESPONSE 
NotificationStatus NOTIFICATION_CONTINUE 

ModuleName DynamicCompressionModule 
Notification 256 
fIsPostNotification true  
Notification RELEASE_REQUEST_STATE 

ModuleName DynamicCompressionModule 
Notification 256 
fIsPostNotificationEvent true 
NotificationStatus 0 
Notification RELEASE_REQUEST_STATE 
NotificationStatus NOTIFICATION_CONTINUE 

我正在尝试压缩我的 aspx 文件。任何帮助,将不胜感激。谢谢。

4

2 回答 2

1

您确定在 IIS 中安装了动态压缩吗?默认情况下,它未安装在 Server 2008(或 R2)上。试试这篇文章:http ://www.iis.net/ConfigReference/system.webServer/urlCompression

于 2012-07-26T17:34:05.050 回答
1

检查此线程,听起来您遇到了类似的问题:

如何在 IIS7 中进行 gzip 压缩?

于 2011-02-28T19:52:19.813 回答