0

I'm trying to delete all cache of a browser, however it doesn't get deleted. Here is the code where i set expire some cookies that i know. what about cache, any suggestions?

string[] cookies = Request.Cookies.AllKeys;
foreach (string cookie in cookies)
{
   Response.Cookies[cookie].Expires = DateTime.Now.AddYears(-1);
}
user2483797
  • 169
  • 1
  • 5
  • 13
  • 1
    AFAIK you can't. That would open a very big security issue. If you want to make sure that the browser gets some content from your server instead of fetching from the client's cache, then serve with a different query string every time. – Geeky Guy Jan 22 '14 at 12:33
  • You can't. See [How to clear browser cache programatically?](http://stackoverflow.com/questions/8306839/how-to-clear-browser-cache-programatically). – CodeCaster Jan 22 '14 at 12:33

0 Answers0