Spaces:
Running
Running
File size: 583 Bytes
1d919a0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | // Encryptid EdgeAI. Pass the network through so the page keeps its
// isolation headers. The install only needs this fetch handler.
self.addEventListener("install", (event) => {
event.waitUntil(self.skipWaiting());
});
self.addEventListener("activate", (event) => {
event.waitUntil(self.clients.claim());
});
self.addEventListener("fetch", (event) => {
if (event.request.method !== "GET") return;
// Honor the server cache. The wasm is cacheable for a day. Forcing
// no-store here made every visit download the model again.
event.respondWith(fetch(event.request));
});
|