我已插入HttpCompress模块来为我的 MVC Web 应用程序启用压缩。
如果我通过开发 Web 服务器 (Cassini) 运行我的网站,则执行压缩不会有任何问题。
但是,当我将站点部署到 IIS6 时,没有执行压缩。我检查了压缩库的源代码,并且 CompressContent 处理程序返回而不采取任何行动,因为存在空值
app.Request.Headers["Accept-Encoding"]
我最好的猜测是,这与 IIS6 中无扩展 url 的处理有关。我需要做些什么来解决生产中的这个问题?
[下面是模块的配置,如果有帮助的话]
<blowery.web>
<httpCompress preferredAlgorithm="deflate" compressionLevel="high">
<excludedMimeTypes>
<add type="image/jpeg" />
<add type="image/png" />
<add type="image/gif" />
<add type="application/pdf" />
</excludedMimeTypes>
<excludedPaths></excludedPaths>
</httpCompress>
</blowery.web>