1

I try to clear the chrome browser cache using Add-ons. I am developing as a site using JSP with java, I need to clear the browser cache for the security reason. I tried many ways to clear the cache but none seems to work. Any ideas? Please let me know..

sathish anish
  • 463
  • 1
  • 5
  • 17
  • There's already an answer that might help you - https://stackoverflow.com/questions/8155064/how-to-programmatically-empty-browser-cache – Gigacore Sep 19 '17 at 06:36

3 Answers3

2

Cache.delete()

can be used for new chrome, firefox and opera.

try it please in js File

1

There's no way a browser will let you clear its cache. It would be a huge security issue if that were possible. This could be very easily abused - the minute a browser supports such a "feature" will be the minute I uninstall it from my computer.

What you can do is to tell it not to cache your page, by sending the appropriate headers or using these meta tags.

Source: https://stackoverflow.com/a/8155121/5437621

mrid
  • 5,782
  • 5
  • 28
  • 71
  • 3
    This is not true. you can via `caches.keys()` and `caches.delete(cacheKey)` as described in detail here: https://developer.mozilla.org/en-US/docs/Web/API/Cache – Dane Jordan Jan 07 '20 at 02:43
1
  • call window.location.reload(true) for a ctrl+F5 from script.
  • In the new version of browsers Cache.delete()
  • in meta tag

<meta http-equiv='cache-control' content='no-cache'>
<meta http-equiv='expires' content='0'>
<meta http-equiv='pragma' content='no-cache'>
  • in jQuery $('html[manifest=saveappoffline.appcache]').attr('content', '');
Farhad Bagherlo
  • 6,725
  • 3
  • 25
  • 47