【发布时间】:2018-06-28 14:37:39
【问题描述】:
我在我的 web.config 文件中使用此设置并且我的客户端浏览器缓存了我的 MVC 控制器方法结果?如何以及为什么?我的配置不针对 cshtml 或 Razor 视图。我现在可以做什么来清除我的客户端浏览器缓存?
<system.webServer>
<caching>
<profiles>
<add extension=".png" policy="CacheUntilChange" varyByHeaders="User-Agent" location="Client"/>
<add extension=".gif" policy="CacheUntilChange" varyByHeaders="User-Agent" location="Client"/>
<add extension=".jpg" policy="CacheUntilChange" varyByHeaders="User-Agent" location="Client"/>
<add extension=".js" policy="CacheUntilChange" varyByHeaders="User-Agent" location="Client"/>
<add extension=".css" policy="CacheUntilChange" varyByHeaders="User-Agent" location="Client"/>
</profiles>
</caching>
<httpProtocol allowKeepAlive="true">
<customHeaders>
<add name="Cache-Control" value="public, max-age=691200"/>
</customHeaders>
</httpProtocol>
【问题讨论】:
标签: c# caching model-view-controller browser-cache