【问题标题】:IIS 7.5 no static or dynamic compressionIIS 7.5 无静态或动态压缩
【发布时间】:2011-10-13 15:56:49
【问题描述】:

我无法在新服务器上为 .ASP、.JS 或 .CSS 文件进行静态或动态压缩。

我正在运行 Windows Server 2008 R2 Standard 64 位。在 IIS 角色服务下,我安装了 ASP,以及静态和动态压缩。我将 DefaultAppPool 与标准 ApplicationPoolIdentity 一起使用。我已启用该网站的所有压缩选项。

这是我的 applicationHost.config 的相关部分(这都在 system.webServer 下):

<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
    <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
    <dynamicTypes>
        <add mimeType="text/*" enabled="true" />
        <add mimeType="message/*" enabled="true" />
        <add mimeType="application/x-javascript" enabled="true" />
        <add mimeType="*/*" enabled="false" />
    </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="false" />
    </staticTypes>
</httpCompression>

<serverRuntime frequentHitThreshold="1" />

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

所以我打开了失败的请求跟踪以获得更好的视图。

对于 ASP,它似乎完全跳过了静态和动态压缩。 DYNAMIC_COMPRESSION_SUCCESS 或 DYNAMIC COMPRESSION_NOT_SUCCESS 没有条目。

对于 CSS 和 JS,它会尝试静态压缩但失败:

STATIC_COMPRESSION_NOT_SUCCESS     Reason="NO_MATCHING_SCHEME"

我在网上找不到任何关于 NO_MATCHING_SCHEME 含义的可靠文档。救命!

【问题讨论】:

  • 这是 serverfault.com 的问题
  • 我想知道这一点。我浏览了几乎所有关于压缩的帖子,并在 stackoverflow.com 上看到了一堆问题(和答案)。我也会尝试把它贴在那里。谢谢。
  • DefaultAppPool 是配置为经典模式还是集成模式?
  • 有人有其他想法吗?

标签: asp-classic compression gzip iis-7.5


【解决方案1】:

可能您已将应用程序池配置为使用经典模式:

Some settings in the system.webServer section apply only to IIS 7.0 Integrated mode and do not apply to Classic mode.

尝试通过IIS Manager UI 设置压缩。

【讨论】:

  • DefaultAppPool 配置为集成。我试过将它切换到经典,它没有任何区别。 stackoverflow.com/questions/4662764/… 实际上与我的问题非常相似......当我执行失败的请求跟踪时,我在 ASP 文件上获得了相同的动态压缩状态消息。
  • 另外,我已经通过 IIS 管理器 UI 设置了压缩,最后尝试调整 applicationHost.config。无论如何都没有运气。我想知道配置文件是否搞砸了。任何人都可以从具有工作静态/动态压缩的服务器向我发送 applicationHost.config 吗?
猜你喜欢
  • 2013-03-08
  • 2015-05-22
  • 2015-01-23
  • 2011-06-07
  • 1970-01-01
  • 2016-01-02
  • 1970-01-01
  • 1970-01-01
  • 2014-11-28
相关资源
最近更新 更多