iis7上的gzip http压缩问题

发布于 2024-08-28 23:50:30 字数 1320 浏览 5 评论 0原文

我的网络托管提供商正在运行 IIS7,但我在让 gzip 压缩正常工作方面遇到了很多麻烦。主机管理员说已安装压缩。我可以使用一些在线检查服务确认压缩,但不能使用其他服务。 PageSpeed Firefox 插件还表示该网站未压缩。我个人坐在 Squid 代理后面,但 web.config 设置应该解决代理问题。下面是相关的 web.config 片段。大部分都是从各个网站借来的。有什么想法吗?

    <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>

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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

活雷疯 2024-09-04 23:50:30

这篇文章大约有 4 个月了,但是你检查过 IIS 中是否启用了动态压缩吗?这里有一篇文章介绍如何做到这一点
http://blog.wassupy.com/2009/ 08/enabling-dynamic-http-compression-in.html

默认情况下 IIS 未启用它。可能值得尝试。

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

By default IIS it isn't enabled. Might be worth trying.

梦回梦里 2024-09-04 23:50:30

尝试以下两个方法来解决此问题:

  1. 尝试遵循在 web.config 中设置布尔值的大小写标准并使用小写而不是 pascal 大小写。

  2. 如果您的主机允许,请尝试通过 IIS 连接到服务器上的站点,并检查压缩部分是否已锁定。

    如果您的主机允许,请

Try two this towards resolving this issue:

  1. Try following the case standard for setting booleans in the web.config and use lower case rather than pascal casing.

  2. Try connecting to the site on the server via IIS if your host allows this and check the compression section to see if it is locked.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文