Last active
February 1, 2019 18:31
-
-
Save jonchenn/e412adeee5ce20df9a6d85c51c549b8c 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', async (event) => { | |
if (event.request.method === 'POST') { | |
// Respond with cached data and update from network in the background. | |
event.respondWith(staleWhileRevalidate(event)); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment