禁用整個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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章