IIS 7静态文件压缩问题
我们有 3 个运行 IIS7 的 Web 服务器。 我已启用静态和动态内容的压缩。 我们一直在高负载下测试服务器,半小时后网站上的样式开始崩溃。
我开始调查,发现 IIS 使用 Content-Encoding: gzip 提供 css 和 js 文件,但实际文件内容并未压缩。 这会导致浏览器在尝试处理内容时出错。 如果我重新启动 IIS,该问题就会消失。
有人遇到过类似的问题吗? 诊断问题的最佳方法是什么?
谢谢
We have 3 web servers running IIS7. I've enabled compression for static and dynamic content. We have been testing the servers under heavy load and after half an hour the styles on the site started breaking.
I started investigating and found out that IIS was serving css and js files with Content-Encoding: gzip but the actual file content is not compressed. This cause the browsers to give error when trying to process the content. The issue disappears if I restart IIS.
Have anyone experienced a similar issues? What is the best way to diagnose the issue?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
该问题是由我们使用的 CMS (sitecore) 引起的。 我们升级到了更高版本,从那时起它就一直有效。 这可能是第 3 方 httpmodule 引起的问题。
The problem was caused by the CMS (sitecore) we were using. We upgraded to a later version and it has worked ever since. It's probably a 3rd party httpmodule causing the issue.
您是否查看过 http://support.microsoft.com/kb/969062 ?
托马斯·KR
Did you have a look at http://support.microsoft.com/kb/969062 ?
KR, Thomas
当页面加载后刷新时,我们的网站无法提取 JS 和 CSS。
我在 IIS 7.5 中关闭了静态文件压缩,站点又恢复正常了。 这促使我对为什么会发生这种情况进行了一些调查。
对于我们来说,出现问题的原因是该站点有一些以编程方式实现 GZIP 编码的遗留代码,而 IIS 7.5 与其发生冲突。 我们删除了遗留代码,并重新启用静态文件压缩。
Our site was failing to pull JS and CSS in when the page was refreshed after loading.
I switched static file compression off in IIS 7.5, and the site was fine again. This led me to do some investigation into why this might be happening.
For us, the problem occurred because the site had some legacy code that programmatically implemented GZIP encoding, and IIS 7.5 was conflicting with it. We removed the legacy code, and switched static file compression back on.