我无法获取图像文件缓存。我尝试了在本网站和其他网站上找到的所有内容,但仍然无法让它们缓存。我曾尝试IIS 7.5和图像未被缓存
<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>
这里
的Web配置设置对于图像的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默认缓存静态内容。当您检查标题时,请确保您的开发工具没有设置为禁用缓存的选项。 – ajbeaven