目前我已经配置了静态压缩和动态压缩。静态压缩正在工作,但是通过 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文件压缩。希望能得到帮助。谢谢。