Spaces:
Running on Zero
Running on Zero
AI KING Studio v2: real ZeroGPU generators (FLUX.1 schnell + LTX-Video), Audio Lab, stats, PWA, redesign
08e06c9 verified Download static/sw.js from INTERNETCON/AI-KING-Studio: direct link, hf CLI and curl.
- Browser
- Download file 738 Bytes
-
https://huggingface.co/spaces/INTERNETCON/AI-KING-Studio/resolve/main/static/sw.js
- Command line
-
hf download hf://spaces/INTERNETCON/AI-KING-Studio/static/sw.js
-
curl -L -o sw.js https://huggingface.co/spaces/INTERNETCON/AI-KING-Studio/resolve/main/static/sw.js
738 Bytes
| // AI KING©️ service worker: network-first, tiny offline fallback. Never caches API/queue traffic. | |
| const CACHE = 'aiking-v2'; | |
| const OFFLINE = '/offline'; | |
| self.addEventListener('install', e => { | |
| e.waitUntil(caches.open(CACHE).then(c => c.addAll([OFFLINE, '/gradio_api/file=static/icons/icon-192.png'])).then(() => self.skipWaiting())); | |
| }); | |
| self.addEventListener('activate', e => { | |
| e.waitUntil(caches.keys().then(ks => Promise.all(ks.filter(k => k !== CACHE).map(k => caches.delete(k)))).then(() => self.clients.claim())); | |
| }); | |
| self.addEventListener('fetch', e => { | |
| const r = e.request; | |
| if (r.method !== 'GET' || r.mode !== 'navigate') return; // only page loads | |
| e.respondWith(fetch(r).catch(() => caches.match(OFFLINE))); | |
| }); | |