Clearing Browser Cache on browser back button click in Asp.Net

Vishalneeraj-24503
Posted by Vishalneeraj-24503 under ASP.NET category on | Points: 40 | Views : 339
If we want to apply the "no cache on browser back" behavior on all pages then we should put it in global.asax file as follows:-

protected void Application_BeginRequest()
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));
Response.Cache.SetNoStore();
}

Comments or Responses

Login to post response