【问题标题】:HTTP expire date and IIS 7.0 enabled, but not workingHTTP 过期日期和 IIS 7.0 已启用,但无法正常工作
【发布时间】:2012-03-23 11:07:00
【问题描述】:

我在 IIS manager-> MySite -> HTTP Response Headers -> Set Common Headers -> Expire Web Content -> After 7 days.

这在web.config 中得到了正确反映。顺便说一句,Google Page Speed online 和 Google Page Speed 作为 Firebug 扩展都在说“未指定到期”。

【问题讨论】:

    标签: iis iis-7 asp-classic browser-cache pagespeed


    【解决方案1】:

    此设置仅影响静态内容,而不影响 asp 和 asp.net 等引擎生成的内容。

    另外,IIS7 在响应 HTTP/1.1 请求时不发送 Expires 标头,而是使用 Cache-Control 标头。

    在 ASP-Classic 中,您应该使用Response.Expires 属性和AddHeader 方法来添加Cache-Control 标头。在 ASP.NET 中,Response.Cache 属性公开了一个对象,该对象具有许多属性,您可以通过这些属性控制服务器端和客户端的缓存。

    【讨论】:

    • 实际上,静态 GIF 图像的缓存标头也不正确 (Cache-control non cache)。 Here the headers.
    猜你喜欢
    • 1970-01-01
    • 2021-12-09
    • 2010-12-30
    • 2011-06-16
    • 2013-05-21
    • 2019-09-30
    • 1970-01-01
    • 2011-08-12
    • 1970-01-01
    相关资源
    最近更新 更多