24 lines
701 B
JavaScript
24 lines
701 B
JavaScript
// Minimal PWA service worker with no API caching
|
|
|
|
self.addEventListener("install", (event) => {
|
|
// Skip waiting so updated SW takes control faster
|
|
// but we do not pre-cache anything to keep behavior minimal
|
|
// @ts-ignore
|
|
self.skipWaiting();
|
|
});
|
|
|
|
self.addEventListener("activate", (event) => {
|
|
// Claim clients so the SW starts controlling pages immediately
|
|
// @ts-ignore
|
|
event.waitUntil(self.clients.claim());
|
|
});
|
|
|
|
self.addEventListener("fetch", (event) => {
|
|
const request = event.request;
|
|
|
|
// Do not cache anything; just let the request pass through.
|
|
// Especially do not touch API requests.
|
|
// If needed in future, add logic here, but keep it disabled for now.
|
|
return;
|
|
});
|