v2: PWA install, golden hour calc, hands-free voice commands, HYPE button, thirds overlay, frame strip, kokoro keep-warm, llms.txt
This commit is contained in:
8
static/sw.js
Normal file
8
static/sw.js
Normal file
@@ -0,0 +1,8 @@
|
||||
const C='lyra-v2';
|
||||
self.addEventListener('install',e=>self.skipWaiting());
|
||||
self.addEventListener('activate',e=>e.waitUntil(clients.claim()));
|
||||
self.addEventListener('fetch',e=>{
|
||||
if(e.request.method!=='GET'||e.request.url.includes('/api/'))return;
|
||||
e.respondWith(caches.open(C).then(c=>c.match(e.request).then(r=>
|
||||
r||(fetch(e.request).then(res=>{if(res.ok)c.put(e.request,res.clone());return res}).catch(()=>r)))));
|
||||
});
|
||||
Reference in New Issue
Block a user