Created
January 27, 2019 12:33
-
-
Save zprima/f76c64344f8997bed98dbed9bea652ac to your computer and use it in GitHub Desktop.
medium_p2_c5
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('fetch', function (event) { | |
event.respondWith( | |
caches.match(event.request).then(function (response) { | |
return response || fetch(event.request); | |
}) | |
); | |
}); | |
self.addEventListener('install', function (e) { | |
e.waitUntil( | |
caches.open('the-magic-cache').then(function (cache) { | |
return cache.addAll([ | |
'/', | |
'/index.html', | |
'/app.js', | |
'/sw.js', | |
'/styles.css' | |
]); | |
}) | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment