Skip to content

Instantly share code, notes, and snippets.

@deanhume
Created September 20, 2017 08:22
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save deanhume/4b7e1f136cbee288cff9f0fc46318fbb to your computer and use it in GitHub Desktop.
Save deanhume/4b7e1f136cbee288cff9f0fc46318fbb to your computer and use it in GitHub Desktop.
Clear Service Worker Cache
if ('serviceWorker' in navigator) {
caches.keys().then(function(cacheNames) {
cacheNames.forEach(function(cacheName) {
caches.delete(cacheName);
});
});
}
@adrianoOliveiraRocha
Copy link

Thanks! :)

@SerialAnonymous
Copy link

Thanks this worked for me

@ponceleon
Copy link

same for me thanks

@ghasemi1994
Copy link

thank u , this code work after new release.
i'm using of service worker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment