Last active
December 13, 2018 09:59
-
-
Save adrienZ/58039541264e22a53837134c30fe5672 to your computer and use it in GitHub Desktop.
Service worker activation and cache cleaning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| self.addEventListener('activate', function(event) { | |
| event.waitUntil( | |
| caches.keys().then(function(cacheNames) { | |
| return Promise.all( | |
| cacheNames.map(function(cacheName) { | |
| return caches.delete(cacheName); | |
| }) | |
| ); | |
| }) | |
| ); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment