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