0

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?

1 Answer 1

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();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.