Auto clear cache from browser
You have 3 options:
- Put this in the head section of your html page :
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
This will make your app to not cache anything at all ( at least you can keep it during
development)
Use hard refresh for example ctrl+f5 if you are using chrome every time you reload.
Use a Cache killer plugin for your browser. There's a bunch of them out there, you just install them and enable them whenever you want.
How to clear cache of service worker?
Use this to delete outdated caches:
self.addEventListener('activate', function(event) {
event.waitUntil(
caches.keys().then(function(cacheNames) {
return Promise.all(
cacheNames.filter(function(cacheName) {
// Return true if you want to remove this cache,
// but remember that caches are shared across
// the whole origin
}).map(function(cacheName) {
return caches.delete(cacheName);
})
);
})
);
});
Related Topics
How to Get the Name of the Current Windows User in JavaScript
How to Detect If Url Has Changed After Hash in JavaScript
Javascript Function Not Defined Error (But It Is Defined)
Regex to Replace Everything Except Numbers and a Decimal Point
How to Call Make Angular Service Synchronous
How to Read a CSV File into a 2D Array in JavaScript
Center Content Vertically on Vuetify
How to Get the Value by a Key from a Super Nested Json
Javascript or Jquery Browser Back Button Click Detector
What Is the Best Method to Swap Words in a String
Getting Name of Parent Object from Value of Object
Hide Div If Value Is Blank (Javascript)
Javascript Scrollto Method Does Nothing
How to Check Whether Session Is Null or Not in JavaScript
Uncaught Typeerror: Cannot Read Property 'Click' of Null Chrome Extension
Bootstrap 4 Dropdown Menu Not Working
Angularjs:Ng-Model Binding Not Updating When Changed With Jquery