iis7上的Gzip HTTP压缩问题 [英] Gzip http compression problem on iis7
问题描述
我的网络托管服务提供商正在运行IIS7,但我遇到了很多麻烦,无法使gzip压缩正常工作.主机管理员说已安装压缩功能.我可以使用某些在线检查服务来确认压缩,但不能与其他服务一起使用. PageSpeed Firefox附加组件还表示该网站未压缩.我个人坐在Squid代理后面,但web.config设置应解决代理问题.以下是相关的web.config代码段.大部分是从各个站点借来的.有什么想法吗?
My web hosting provider is running IIS7 and I am having loads of trouble to get gzip compression to work properly. Host admins say compression is installed. I can confirm compression using some online checking services but not with others. PageSpeed Firefox add-on also says the site is uncompressed. I am personally sitting behind a Squid proxy but web.config settings should take care of proxy issue. Below is the relevant web.config snippet. Most of it is borrowed from various sites. Any thoughts?
<urlCompression doDynamicCompression="true" dynamicCompressionBeforeCache="true" doStaticCompression="true" />
<httpCompression cacheControlHeader="max-age=86400" noCompressionForHttp10="False" noCompressionForProxies="False" sendCacheHeaders="True" dynamicCompressionEnableCpuUsage="89" dynamicCompressionDisableCpuUsage="90" minFileSizeForComp="1" noCompressionForRange="False">
<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>
推荐答案
这篇文章已有4个月的历史了,但是您是否检查了IIS中是否启用了动态压缩?这里有一篇关于如何做的文章 http://blog.wassupy.com/2009/08/enabling-dynamic-http-compression-in.html
This post is about 4 months old, but have you checked if dynamic compression is enabled in IIS? There's an article here on how to do it http://blog.wassupy.com/2009/08/enabling-dynamic-http-compression-in.html
默认情况下未启用IIS.可能值得尝试.
By default IIS it isn't enabled. Might be worth trying.
这篇关于iis7上的Gzip HTTP压缩问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!