Skip to content

Instantly share code, notes, and snippets.

@enix-app
Forked from deanhume/clear-cache.js
Created September 22, 2020 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enix-app/b0b3592816575c31950e437c015c8b5f to your computer and use it in GitHub Desktop.
Save enix-app/b0b3592816575c31950e437c015c8b5f 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);
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment