So, I have an HTML page with service worker, the service worker cache the index.html and my JS files.
The problem is when I change the JS, the change doesn\'t show u
If you know the cache name you can simply call caches.delete() from anywhere you like in the worker:
caches.delete(/*name*/);
And if you wanted to wipe all caches (and not wait for them, say this is a background task) you only need to add this:
caches.keys().then(function(names) {
for (let name of names)
caches.delete(name);
});