diff options
author | Anton Šijanec <sijanecantonluka@gmail.com> | 2020-03-30 15:16:31 +0200 |
---|---|---|
committer | Anton Šijanec <sijanecantonluka@gmail.com> | 2020-03-30 15:16:31 +0200 |
commit | c3f69a0d4b18fb92b7d24810885c2efff52e7a5b (patch) | |
tree | 02685d2287e1248e3e6e2a8f001397a3e57c8fce /sw - Copy.js | |
parent | initial commit (diff) | |
download | upn-master.tar upn-master.tar.gz upn-master.tar.bz2 upn-master.tar.lz upn-master.tar.xz upn-master.tar.zst upn-master.zip |
Diffstat (limited to 'sw - Copy.js')
-rw-r--r-- | sw - Copy.js | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/sw - Copy.js b/sw - Copy.js deleted file mode 100644 index c1f9f91..0000000 --- a/sw - Copy.js +++ /dev/null @@ -1,46 +0,0 @@ -// Change version to cause cache refresh, sw.js SE NE SME CACHAT aka ne ga dat v assets! -const static_cache_name = "site-static-v0.0.7"; -const assets = [ - "./", - "./courbd.ttf", - "./favicon.ico", - "./favicon.png", - "./iso-8859-2.js", - "./myriadpro.otf", - "./myriadpro-semibold.otf", - "./qr.html", - "./qrcode.js", - "./qrcode.tosjis.js", - "./upn.html", - "./upn.svg", - "./index.html", - "./512x512.png", - "./192x192.png", - "./manifest.json" -]; - -self.addEventListener("install", (evt) => { - evt.waitUntil( - caches.open(static_cache_name).then((cache) => { - cache.addAll(assets); - }) - ); -}); - -// Delete old caches -self.addEventListener("activate", evt => { - evt.waitUntil( - caches.keys().then((keys) => { - return Promise.all(keys - .filter(key => key !== static_cache_name) - .map(key => caches.delete(key)) - ); - }) - ); -}); - -self.addEventListener("fetch", (evt) => { - evt.respondWith(caches.match(evt.request).then((cache_res) => { - return cache_res || fetch(evt.request); - })) -}); |