init
This commit is contained in:
16
public/serviceworker.js
Normal file
16
public/serviceworker.js
Normal file
@@ -0,0 +1,16 @@
|
||||
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) => {})
|
||||
Reference in New Issue
Block a user