Skip to content

Instantly share code, notes, and snippets.

@jacky810124
Created March 28, 2018 12:55
Show Gist options
  • Save jacky810124/1f3b48516b49cc0ddbe5d824193366e7 to your computer and use it in GitHub Desktop.
Save jacky810124/1f3b48516b49cc0ddbe5d824193366e7 to your computer and use it in GitHub Desktop.
PWA Day 06 - cache falling back to network
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