高速缓存控制头&浏览器缓存IIS7 [英] Cache-Control Header & Browser Caching IIS7

查看:271
本文介绍了高速缓存控制头&浏览器缓存IIS7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IIS7的网站上使用Google Page Speed,我想知道如何设置

I am using Google Page Speed on my website in IIS7 and I was wondering how to set

利用浏览器缓存以下资源缺少缓存expiration employ
利用代理缓存 - 请考虑为以下资源添加Cache-Control:public标头。

Leverage browser caching - The following resources are missing a cache expiration
Leverage proxy caching - Consider adding a "Cache-Control: public" header to the following resources.

我在我的web.config中使用doDynamicCompression并且很困惑如何设置这些?希望获得一些帮助

I am using doDynamicCompression in my web.config and little confused how to set these ? Hoping for some help

注意:正在使用引用 http://www.iis.net/ConfigReference/system.webServer/httpCompression

推荐答案

在system.webServer下的web.config中设置例如

Under system.webServer in web.config set for example

<caching>
            <profiles>
                <add extension=".png" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" location="Any" />
                <add extension=".jpg" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" location="Any" />
                <add extension=".gif" policy="CacheUntilChange" kernelCachePolicy="CacheUntilChange" location="Any" />
            </profiles>
        </caching>

这也可以从IIS管理器在输出缓存下配置,但GUI不做的是设置'location'属性。将其设置为任何将设置Cache-Control:public。

This can also be configured from IIS Manager under Output Caching but what the GUI doesn't do is set the 'location' attribute. Setting it to 'Any' will set Cache-Control:public.

您可以阅读更多有关此处

这篇关于高速缓存控制头&amp;浏览器缓存IIS7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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