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..
            Asked
            
        
        
            Active
            
        
            Viewed 4.5k times
        
    1
            
            
        - 
                    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 Answers
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.
 
    
    
        mrid
        
- 5,782
- 5
- 28
- 71
- 
                    3This 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
 
    