Last active
December 23, 2019 13:55
-
-
Save alexpermiakov/9a11d5ccfecdaca231aa060f8ed47a6c 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', function(event) { | |
event.respondWith( | |
caches.open(CACHE_NAME).then(function(cache) { | |
return cache.match(event.request).then(function (response) { | |
return response || fetch(event.request).then(function(response) { | |
return response; | |
}); | |
}); | |
}) | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment