Created
March 11, 2018 18:24
-
-
Save ritikrishu/72bcf989dcbf2c01843d6265f0c2322e to your computer and use it in GitHub Desktop.
using cache addAll on Service Worker install
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
self.addEventListener('install', function (event) { | |
event.waitUntil( | |
caches.open('your cache name').then(function (cache) { | |
return cache.addAll([ | |
'/some-route', | |
'js/my-app.js', | |
'css/my-app.css', | |
'imgs/my-app.png', | |
'https://fonts.gstatic.com/s/roboto/v15/2UX7WLTfW3W8TclTUvlFyQ.woff', | |
'https://fonts.gstatic.com/s/roboto/v15/d-6IYplOFocCacKzxwXSOD8E0i7KZn-EPnyo3HZu7kw.woff', | |
... | |
]); | |
}) | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment