问题描述
如果用户的浏览器是 IE6(它会在较大站点的几个页面中挂起浏览器 5 分钟),我们需要有条件地禁用 GZIP 压缩.服务器是 IIS7 并且已打开静态内容的压缩 - 如果用户代理不是 Mozilla/4.0,则希望该压缩继续工作.ASPX 代码示例有人吗?或者,有条件地重定向到另一个站点上的同一页面的代码(可以创建另一个禁用压缩的虚拟站点)但需要传递所有参数(GET/POST).
We need to conditionally disable GZIP compression if user's browser is IE6 (it hangs browser for 5min) in few pages of larger site. Server is IIS7 and has compression for static content turned on - want that compression left working if user agent is not Mozilla/4.0. ASPX code sample anyone? Alternatively, code to conditionally redirect to the same page on another site (could create another virtual site with compression disabled) but need to pass all parameters (GET/POST).
推荐答案
如果请求来自 IE5/IE6,请尝试拦截浏览器的请求以停止声称支持 Gzip.我相信 ISAPI 重写可用于 IIS.
Try intercepting the browser's request to stop claiming support for Gzip, if the request is from IE5/IE6 . I believe ISAPI rewrite is available for IIS.
请注意:这并不要求您拥有单独的 gzip 和非 gzip 页面.这可能是比您的建议更好的方法,因为它从源头上解决了问题.
Take note: this does not require you to have separate gzipped and non-gzipped pages. This is probably a better approach than your proposal, since it cuts the problem at its source.
这篇关于禁用 IE6 客户端的 GZIP 压缩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!