Created
June 19, 2018 09:11
-
-
Save goofmint/2d1b795d54d680711b346621977106a5 to your computer and use it in GitHub Desktop.
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', e => { | |
// 外部リソース取得時 | |
console.log('fetch', e.request.url); | |
e.respondWith( | |
caches.match(e.request, { | |
ignoreSearch:true | |
}) | |
.then(response => { | |
return response || fetch(e.request); | |
}) | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment