Skip to content

Instantly share code, notes, and snippets.

@petebrowne
Last active February 19, 2016 21:47
Show Gist options
  • Save petebrowne/af66e718de5cd1322576 to your computer and use it in GitHub Desktop.
Save petebrowne/af66e718de5cd1322576 to your computer and use it in GitHub Desktop.
self.addEventListener('activate', event => {
event.waitUntil(
caches.keys().then(cacheNames => {
return Promise.all(
cacheNames.map(cacheName => {
if (cacheName !== CACHE_NAME) {
console.log('Deleting out of date cache:', cacheName);
return caches.delete(cacheName);
}
})
);
})
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment