interplane.Get Omega
Read in your language

aien-sovereign-core

Autonomous sovereign intelligence engine and runtime core for NVIDIA DGX Spark

Brought by drakestapleton

branch main Branches Tags History

aien-sovereign-core / crates / spark-cockpit-rs / static / sw.js

28 lines · 609 bytes Raw Blame History
1const CACHE_NAME = "aien-cockpit-v1";
2const ASSETS = [
3 "/",
4 "/manifest.json",
5 "/icon-192.png",
6 "/icon-512.png"
7];
8
9self.addEventListener("install", (e) => {
10 e.waitUntil(
11 caches.open(CACHE_NAME).then((cache) => cache.addAll(ASSETS))
12 );
13 self.skipWaiting();
14});
15
16self.addEventListener("activate", (e) => {
17 e.waitUntil(self.clients.claim());
18});
19
20self.addEventListener("fetch", (e) => {
21 // Pass dynamic API and stream calls directly through
22 if (e.request.url.includes("/api/")) {
23 return;
24 }
25 e.respondWith(
26 caches.match(e.request).then((res) => res || fetch(e.request))
27 );
28});