問題:
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