Created
August 14, 2018 14:20
-
-
Save goofmint/39570ee0d1d6f06334bae2ae2c024808 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
const channel = new MessageChannel(); | |
navigator.serviceWorker.controller | |
.postMessage({ | |
action: 'cache', | |
url: res.req.url, | |
response: body | |
}, [channel.port2]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment