Can I clear browser cache of the page when I'm leaving it.
// Clear browser cache
Response.Redirect("otherpage.html");
By "clean browser cache" I didn't mean all the cache. I meant make user download the page next time he goes back to it (by pressing back button in my case).
Edit Usually Sky Sanders suggestion works. In fact that what I tried right away, but even though it worked for simple page it failed when putting Response.Redirect after cache headers. Even though FF received headers it still provided me with a cached page when I pressed back button.
The only way you can control caching from the content end of the stick is to prevent caching in the first place.
context.Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
context.Response.Cache.SetNoStore();
You cannot invoke methods on the client browser.
No, you can't clear the browser cache from your web app. You could clear the cookies but that's about it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With