In Chrome it is possible to clear the Service Worker cache from the Dev Tools.
How can we achieve that in Firefox?
I've tried so far:
about:serviceworkers
about:preferences#privacy
Ctrl + F5
but it's still there...
to open the menu panel. Click History and select Clear Recent History…. Next to Time range to clear, choose Everything from the drop-down menu, select Cache in the items list, make sure other items you want to keep are not selected and then click the OK button.
So my answer is: Yes, you can delete it from Explorer. If you are worried about safety, you may at first step move the contents to a temporary folder and run Microsoft Edge. If everything works well, you may then delete the temporary folder. Note: Google Chrome behaves in exactly the same way.
It is not possible to clear the cache for just one website, any clear operation that involves a cache clears the full cache. This even happens if you would use "Forget About This Site" to clear data from a specific website. With cookies and local storage this is possible, but for a cache this isn't possible.
Type this in the address bar of Firefox and deregister the service workers you want.
about:debugging#workers
EDIT: In newer versions #worker
anchor does not works. You will have to scroll down to Service Workers
section.
You can execute following code snippet in Firefox Web Console:
caches.keys().then(function (cachesNames) { console.log("Delete " + document.defaultView.location.origin + " caches"); return Promise.all(cachesNames.map(function (cacheName) { return caches.delete(cacheName).then(function () { console.log("Cache with name " + cacheName + " is deleted"); }); })) }).then(function () { console.log("All " + document.defaultView.location.origin + " caches are deleted"); });
For more information about this code snippet check Cache Web API page on MDN.
You can't clear Service Worker cache using Storage Inspector in current version of Firefox. See Storage Inspection documentation about currently available features. You can't use about:preferences#privacy
or unregister Service Worker because Service Worker cache works independently of browser HTTP cache and managed only by your scripts. Relevant excerpt from Service Worker specification:
5.2 Understanding Cache Lifetimes The Cache instances are not part of the browser's HTTP cache. The Cache objects are exactly what authors have to manage themselves. The Cache objects do not get updated unless authors explicitly request them to be. The Cache objects do not expire unless authors delete the entries. The Cache objects do not disappear just because the service worker script is updated. That is, caches are not updated automatically. Updates must be manually managed. This implies that authors should version their caches by name and make sure to use the caches only from the version of the service worker that can safely operate on.
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