diff --git a/sw.js b/sw.js index 2ca8288..c1b9c18 100644 --- a/sw.js +++ b/sw.js @@ -1,6 +1,8 @@ // gandora's service worker: the shell is cached so the app opens and the library plays with no signal. // Tracks live in IndexedDB already; the DJ and new renders need the network and the page says so. -const SHELL = "gandora-shell-v1"; +// REV is stamped by the shots workflow on every push, so an installed app sees each update as a new worker. +const REV = "dev"; +const SHELL = "gandora-shell-" + REV; const FILES = ["/", "/index.html", "/brain.js", "/favicon.svg", "/manifest.json", "/icons/icon.svg"]; self.addEventListener("install", (e) => { e.waitUntil(caches.open(SHELL).then((c) => c.addAll(FILES)).then(() => self.skipWaiting())); }); self.addEventListener("activate", (e) => { e.waitUntil(caches.keys().then((ks) => Promise.all(ks.filter((k) => k !== SHELL).map((k) => caches.delete(k)))).then(() => self.clients.claim())); });