如何在ASP.NET中将缓存控制设置为“无缓存,无存储”?我是否必须实现缓存每个响应的缓存模块,还是可以使用ASPX页面本身的OutputCache来完成?
答案 0 :(得分:1)
Response.CacheControl = "no-cache";
Response.AddHeader("Pragma", "no-cache");
Response.AddHeader("Pragma", "no-store");
Response.AddHeader("cache-control", "no-cache");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoServerCaching();