tibi-svelte-starter/public/serviceworker.js

13 lines
405 B
JavaScript
Raw Permalink Normal View History

2021-03-22 15:59:05 +01:00
const cacheName = "site-cache-v1"
2022-04-26 11:14:37 +02:00
const assetsToCache = ["/", "/_dist_/index.css?t=__TIMESTAMP__", "/_dist_/index.mjs?t=__TIMESTAMP__"]
2021-03-22 15:59:05 +01:00
self.addEventListener("install", (event) => {
self.skipWaiting() // skip waiting
event.waitUntil(
caches.open(cacheName).then((cache) => {
return cache.addAll(assetsToCache)
})
)
})
self.addEventListener("fetch", (event) => {})