如何关闭整个 ASP.NET MVC 站点的浏览器缓存?
我想禁用网站上每个页面的浏览器缓存。我知道我可以按操作执行此操作,但我想知道是否有办法在整个站点范围内执行此操作。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
拜伦 - 根据你的推动:)
大致如下:
干杯 - 周末愉快,
吉姆
Byron - as per your nudge :)
along the lines of:
Cheers -have a good weekend
jim
如果您使用自定义基本控制器类,您可以重写它的
OnResultExecuting()
方法,并将每个操作使用的相同代码放在那里。If you use custom base controller class, you can override it's
OnResultExecuting()
method and put the same code you would use per action there.