【发布时间】:2015-02-20 10:17:10
【问题描述】:
我正在尝试实施 Google 的 Pagespeed 关于浏览器缓存的建议(在静态内容上设置 Expirer 或 Cache-control 标头)。 在这里阅读了很多帖子(如 IIS7 Cache-Control )和其他网站后,我似乎无法弄清楚为什么 Pagespeed 仍然不批准我的 CSS 文件。
例如:http://test.grotefeesten.nl/clientdata/71/js/jssor.config.js。此文件根据本地 PageSpeed 的过期时间为 1 天,但根据在线 PageSpeed 测试没有。
我的 web.config:
<caching>
<profiles>
<add extension=".css" policy="CacheUntilChange"
kernelCachePolicy="CacheUntilChange" location="Any" />
</profiles>
</caching>
<httpProtocol>
<customHeaders>
<add name="Cache-Control" value="public" />
</customHeaders>
</httpProtocol>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlCustom="max-age"
cacheControlMaxAge="1.00:00:00" />
</staticContent>
有人看到我在这里缺少什么来正确设置 Expires 标头吗?
【问题讨论】:
标签: iis-7 cache-control