【发布时间】:2012-09-14 23:45:28
【问题描述】:
我在特定文件夹中有一些静态内容,jpg、png。
我希望将 HTTP 标头设置为 30 天后过期。
使用 IIS 7.5 >> http 响应标头 >> 设置公共标头 >> 过期网页内容
我添加了我的值,但我仍然得到静态内容的 HTTP 标头(expiration not specified)。
我已经尝试在 IIS 中刷新我的网站,但它没有解决我的问题。
有什么想法吗?
【问题讨论】:
我在特定文件夹中有一些静态内容,jpg、png。
我希望将 HTTP 标头设置为 30 天后过期。
使用 IIS 7.5 >> http 响应标头 >> 设置公共标头 >> 过期网页内容
我添加了我的值,但我仍然得到静态内容的 HTTP 标头(expiration not specified)。
我已经尝试在 IIS 中刷新我的网站,但它没有解决我的问题。
有什么想法吗?
【问题讨论】:
Give this a try with application pool -> ManagedpipelineMode : **Classic**
<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" cacheControlCustom="public"/>
</staticContent>
</system.webServer>
你也可以检查如何在 ui 中配置它 http://www.iis.net/configreference/system.webserver/staticcontent/clientcache
【讨论】: