在IIS7中,gzip压缩文件不会保持这种状态 [英] In IIS7, gzipped files do not stay that way

查看:225
本文介绍了在IIS7中,gzip压缩文件不会保持这种状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将IIS7配置为gzip静态内容。

I have configured IIS7 to gzip static content.

http://www.coderjournal.com/2008/04/iis-7-compress-javascript-gzip/

但是,文件不会保持gzip状态。

However, the files don't "stay" gzipped.

这是我的用例:


  1. 请求test.css文件。它不是gzip压缩。

  2. 请在几秒钟内再次申请。 gzip。

  3. 等待5分钟。

  4. 再次请求test.css文件。它不是gzip。

  1. Request test.css file. It is not gzipped.
  2. Request it again within a few seconds. It is gzipped.
  3. Wait 5 minutes.
  4. Request test.css file again. It is not gzipped.

这没有意义 - 不应该在所有的情况下传送一个静态文件的gzip压缩版本后续请求,如果原始版本没有改变?

This doesn't make sense -- shouldn't the gzipped version of a static file be delivered on all subsequent requests, if the original did not change?

注意:我使用Firefox和Firebug通过检查Content-Encoding标头验证gzip压缩内容。

Note: I am using Firefox and Firebug to verify gzipped content by checking the Content-Encoding header.

推荐答案

根据这篇文章:


IIS7中压缩的变化 Kanwaljeet Singla

在IIS7中,内容根据其命中频率进行压缩可配置如下:

In IIS7, content is compressed depending on it's hit frequency which is configurable like this:

<system.webServer>
  <serverRuntime enabled="true"
    frequentHitThreshold="5"
    frequentHitTimePeriod="00:00:20" />
</system.webServer>

也许你没有达到这些门槛?

Maybe you're not hitting these thresholds?

这篇关于在IIS7中,gzip压缩文件不会保持这种状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆