my-notes-viewer/public/serviceworker.js
2021-03-22 15:59:05 +01:00

17 lines
424 B
JavaScript

const cacheName = "site-cache-v1"
const assetsToCache = [
"/",
"/_dist_/index.mjs.css?t=__TIMESTAMP__",
"/_dist_/index.mjs?t=__TIMESTAMP__",
]
self.addEventListener("install", (event) => {
self.skipWaiting() // skip waiting
event.waitUntil(
caches.open(cacheName).then((cache) => {
return cache.addAll(assetsToCache)
})
)
})
self.addEventListener("fetch", (event) => {})