禁用整个ASP.NET网站的浏览器缓存 - Disable browser cache for entire ASP.NET website

问题:

I am looking for a method to disable the browser cache for an entire ASP.NET MVC Website 我正在寻找一种方法来禁用整个ASP.NET MVC网站的浏览器缓存

I found the following method: 我找到了以下方法:

Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
Response.Cache.SetNoStore();

And also a meta tag method (it won't work for me, since some MVC actions send partial HTML/JSON through Ajax, without a head, meta tag). 还有一个元标记方法(它对我不起作用,因为一些MVC动作通过Ajax发送部分HTML / JSON,没有头部元标记)。

<meta http-equiv="PRAGMA" content="NO-CACHE">

But I am looking for a simple method to disable the browser cache for an entire website. 但我正在寻找一种简单的方法来禁用整个网站的浏览器缓存。


解决方案:

参考一: https://en.stackoom.com/question/4rnN
参考二: https://stackoom.com/question/4rnN
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章