Pragma no-cache

I had a requirement where an aspx page should not be cached in the Temporary Internet Files, simply because we want to reload the page from the server each time. This sort of scenario may present when login or authenticating. Some research and I found this article http://support.microsoft.com/kb/222064.

I was writing code in .Net and luckily its even simpler. Simply add this to the Page_Load

Response.Cache.SetCacheability(HttpCacheability.NoCache);
┬áResponse.AddHeader(“Pragma”, “no-cache”);

Advertisements