Answer: Below mentioned code is useful to clear the Cache stored in the Browser.
Response.ExpiresAbsolute = DateTime.Now;
Response.Expires = -1441;
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();
Note
This code is useful only when the caching is done in the server.
Asked In: Many Interviews |
Alert Moderator