【发布时间】:2012-05-26 01:58:28
【问题描述】:
我无法将图像文件缓存起来。我已经尝试了在此站点和其他站点上找到的所有内容,但仍然无法将它们缓存。
我尝试过的网络配置设置
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="1.00:00:00" />
</staticContent>
<httpProtocol allowKeepAlive="true" />
<caching enabled="true" enableKernelCache="true">
<profiles>
<add extension=".png" policy="CacheUntilChange" />
<add extension=".jpg" policy="CacheForTimePeriod" duration="12:00:00" />
</profiles>
</caching>
这是其中 1 张图片的响应标头
Key Value
Response HTTP/1.1 200 OK
Cache-Control no-cache
Content-Type image/png
Last-Modified Thu, 16 Dec 2004 18:33:28 GMT
Accept-Ranges bytes
ETag "a1ca4bc9de3c41:0"
Server Microsoft-IIS/7.5
X-Powered-By ASP.NET
Date Fri, 18 May 2012 13:21:21 GMT
Content-Length 775
【问题讨论】:
-
IIS 默认缓存静态内容。检查标头时,请确保您的开发工具没有设置禁用缓存的选项。
标签: iis caching iis-7.5 browser-cache