IIS 7 压缩不起作用
我有一个带有 IIS 7 的 Windows Server 2008 R2。
默认情况下,当您在 IIS 中创建站点时,会启用压缩。我检查了压缩模块,两个复选框都被选中。
现在,我使用 fiddler 检查页面是否正在被压缩,但似乎没有,因为选择了“无压缩”并且页面大小超过 100 KB。
即使在 IIS 7 中启用了压缩,为什么页面未压缩?
任何建议都将受到高度赞赏。
谢谢。
I have a Windows server 2008 R2 with IIS 7.
By default when you create a site in IIS, Compression is enabled. I checked the Compression module and both Checkboxes are checked.
Now, I am using fiddler to check if pages are being compressed but it seems they are not as the No Compression is selected and the page size is over 100 KB.
Why pages are Not compressing even though Compression is enabled in IIS 7 ?
Any suggestions will be highly appreciated.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您的页面内容是动态的(即 .aspx 或 .php)吗?如果是,您的 IIS 是否安装了动态内容压缩模块?您可以通过查看“启用动态内容压缩”复选框来判断。如果显示为灰色,则表示未安装。
要安装它,请参考以下链接:
在 IIS7 中启用动态 HTTP 压缩Windows Server 2008
本质上,它说(有很多图片)您必须通过服务器管理器添加动态内容压缩角色服务,然后确保它在 IIS 管理器中启用。
Are your pages' content dynamic (i.e. .aspx or .php)? If so, does your IIS have the dynamic content compression module installed? You can tell by looking at the "Enable dynamic content compression" checkbox. If it is grayed out, then it is not installed.
To install it, please refer to the following link:
Enabling Dynamic HTTP Compression in IIS7 on Windows Server 2008
Essentially, it says (with lots of pictures) that you must add the Dynamic Content Compression role service through Server Manager, and then ensure that it is enabled in IIS Manager.
我找到了一个解决方案:-) 该解决方案始终提供压缩版本。
对我来说,在 IIS 7.5 管理器中,我选中了两个复选框,以便压缩两者:
有时(第一次提供网页),它是未压缩的。
然后,只有第二次,它才被压缩。
以下解决方案来自此处:
http://www.codeproject .com/Articles/242133/Making-the-most-out-of-IIS-compression-Part-conf
为了让 IIS 始终缓存压缩版本,而不是未压缩版本,请修改 applicationHost.config 文件。您通常会在文件夹 C:\Windows\System32\inetsrv\config 中找到此文件:
在 IIS 管理器中,导航到默认网站 >配置编辑器并转到“system.webServer/urlCompression”部分
我希望它会拯救您,因为它救了我!
I've come to a solution :-) This solution ALWAYS serves a compressed version.
For me too, in IIS 7.5 Manager, I have checked Both boxes, in order to compress both :
Sometimes (the first-time a webpage is served), it is UNCOMPRESSED.
Then, only the second time, it is COMPRESSED.
The following solution comes from here :
http://www.codeproject.com/Articles/242133/Making-the-most-out-of-IIS-compression-Part-conf
In order to get IIS to ALWAYS cache the compressed version, rather than the uncompressed version, modify the applicationHost.config file. You'll normally find this file in the folder C:\Windows\System32\inetsrv\config:
In IIS Manager, navigate to Default Website > Configuration Editor and go to the section "system.webServer/urlCompression"
I Hope it will save your day, as it saved mine !
我们遇到了同样的问题,但使用的是 IIS8。关闭动态和静态压缩可以解决问题,但更改设置后需要重新启动 IIS。
We were experiencing the same issue, but with IIS8. Turning off Dynamic and Static compression did the trick, but you'll need to restart IIS after altering the setting.