Reputation: 1864
How can I set cache-control to "no-cache,no-store" in ASP.NET? Do I have to implement a cache module which caches every response, or can it be done using OutputCache in ASPX page itself?
Upvotes: 0
Views: 710
Reputation: 5727
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();
Upvotes: 1