use*_*466 18 iis caching browser-cache iis-7.5
我无法将图像文件缓存.我已尝试过在本网站和其他网站上找到的所有内容,但仍然无法让它们缓存.
我尝试过的Web配置设置
<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>
Run Code Online (Sandbox Code Playgroud)
以下是其中一个图像的响应标题
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
Run Code Online (Sandbox Code Playgroud)
Mar*_*urg 33
以下内容应使浏览器缓存您的图像:
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="1.00:00:00" />
</staticContent>
<httpProtocol>
<customHeaders>
<add name="Cache-Control" value="public" />
</customHeaders>
</httpProtocol>
Run Code Online (Sandbox Code Playgroud)
该<caching>...</caching>块用于服务器端缓存,而不是客户端缓存.
| 归档时间: |
|
| 查看次数: |
24747 次 |
| 最近记录: |