Created
August 14, 2018 14:20
-
-
Save goofmint/c4069d4b4934f7ad4625afb58db78494 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('message', e => { | |
if (e.data.action == 'cache') { | |
caches.open(CACHE_NAME) | |
.then((cache) => { | |
const res = new Response(e.data.response); | |
cache.put(e.data.url, res); | |
}) | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment