-
-
Save tjoskar/1b089d9e1347f70bb790b02241ccd216 to your computer and use it in GitHub Desktop.
serviceworker-install.js
This file contains 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
const staticFilesCache = 'static-files-v1'; | |
const staticFiles = [ | |
'/', | |
'/index.js', | |
'/style.css', | |
'https://fonts.googleapis.com/css?family=Open+Sans' | |
]; | |
self.addEventListener('install', event => { | |
const saveCacheFiles = caches.open(staticFilesCache) | |
.then(cache => cache.addAll(staticFiles)); | |
event.waitUntil(saveCacheFiles); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment