[英]How do I turn off browser caching for my entire ASP.NET MVC site?
I'd like to disable browser caching for every page on my site. 我想为网站上的每个页面禁用浏览器缓存。 I know I can do it per action, but I'd like to know if there's a way to do it site-wide.
我知道我可以按照每个动作进行操作,但是我想知道是否有一种方法可以在整个网站范围内进行。
如果使用自定义基本控制器类,则可以覆盖它的OnResultExecuting()
方法,并在其中放置与每个操作相同的代码。
Byron - as per your nudge :) 拜伦-根据您的微调:)
add the pragma no-cache directive header into the master page!!
along the lines of: 遵循以下原则:
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
Cheers -have a good weekend 干杯-周末愉快
jim 吉姆
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.