更改 IIS7 中 aspx 分页符的响应类型
我有一个 Application_PreRequestHandlerExecute 的自定义实现,它将 deflate/gzip 过滤器应用于响应。然而,在 IIS7 上,这在我的“脚本生成器”页面上失败了。这些 aspx 页面接受查询字符串值并返回自定义的脚本位,将响应类型更改为文本/javascript。我认为它失败是因为 iis7 使用 mime 类型的方式,但我不确定如何在关闭所有压缩的情况下修复它。
有人遇到过这个问题吗?
I have a custom implementation of Application_PreRequestHandlerExecute which is applying a deflate/gzip filter to the response. However, on IIS7, this is failing on my "script generator" pages. These aspx pages take in Query String values and return a custom bit of script, changing the response type to text/javascript. I think it is failing because of the way iis7 uses mime types, but I'm unsure how to fix it short of turning all compressio off.
Anyone faced this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道您正在尝试实现自己的 gzip 过滤器,但为什么不考虑使用第 3 方软件呢?
例如 Helicon Ape 中有 mod_gzip 模块 http://www.helicontech.com/ape /doc/mod_gzip.htm。这是一个非常强大的解决方案,您可以在一行中启用 text/* 压缩,如下所示:
如果您需要排除 javascript,您可以尝试以下操作:
Helicon Ape 对于 3 个网站来说是完全免费的。您可能对此感兴趣。
但如果您不喜欢第 3 方软件,请确保关闭本机 IIS 压缩。您可以通过 IIS 管理器执行此操作,请参阅压缩图标。
在这种情况下,WFetch 也很方便 (http: //www.microsoft.com/downloads/details.aspx?FamilyID=b134a806-d50e-4664-8348-da5c17129210)。最新版本支持 GZIP。
如果您提供一些示例和 WFetch 输出,情况就会一目了然。
谢谢。
I understand you’re trying to implement your own gzip filter, but why don’t you consider 3rd-party software?
For example there is mod_gzip module in Helicon Ape http://www.helicontech.com/ape/doc/mod_gzip.htm. It’s very powerful solution and you may enable text/* compression just in one line as follows:
If you need to exclude javascript, you may try this:
Helicon Ape is totally free for 3 websites. You may be interested in this.
But if you don’t prefer 3rd-party software, please make sure that native IIS compression is switched off. You may do it through IIS manager, see the Compression icon.
WFetch is also handy in such situations (http://www.microsoft.com/downloads/details.aspx?FamilyID=b134a806-d50e-4664-8348-da5c17129210). The latest version understands GZIP.
If you provide a few examples and WFetch output—the situation will look clearly.
Thank you.