Guest User

Untitled

a guest
Dec 14th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. self.addEventListener('install', function(event) {
  2. event.waitUntil(
  3. caches.open(`v${cacheVersion}`)
  4. .then(function(cache) {
  5. return cache.addAll(cacheUrls);
  6. })
  7. );
  8. });
  9. self.addEventListener('fetch', function(event) {
  10. event.respondWith(
  11. caches.match(event.request).then(function(response) {
  12. return response || fetch(event.request);
  13. });
  14. );
  15. });
Add Comment
Please, Sign In to add comment