Skip to content

Instantly share code, notes, and snippets.

Last active January 28, 2022 13:24
What would you like to do?
A service worker file
// Listens to an install event
self.addEventListener("install", (event) => {
// We try to open a cache named "assets".
// If it does not exist, a new one will be created and named "assets""assets").then((cache) => {
// Add an array of path to files you want to add to cache
return cache.addAll([
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment