Skip to content

Instantly share code, notes, and snippets.

@rurickdev
Forked from deanhume/clear-cache.js
Created January 20, 2023 20:38
Show Gist options
  • Save rurickdev/fd9f034b6b22b080140e404407c2b932 to your computer and use it in GitHub Desktop.
Save rurickdev/fd9f034b6b22b080140e404407c2b932 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