Created
March 28, 2018 15:48
-
-
Save jacky810124/7f99e92edcb0b8e6a9ca52aecaa00e84 to your computer and use it in GitHub Desktop.
PWA Day 06 - network falling back to cache
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('fetch', function(event) { | |
event.respondWith( | |
fetch(event.request).catch(function() { | |
return caches.match(event.request) | |
}) | |
) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment