17 lines
424 B
JavaScript
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) => {})
|