Add dummy SWer

This commit is contained in:
Jack Kingsman
2026-04-12 19:06:37 -07:00
parent e1ee7fcd24
commit eed38337c8
2 changed files with 17 additions and 0 deletions

View File

@@ -15,6 +15,11 @@
<link rel="apple-touch-icon" sizes="180x180" href="./apple-touch-icon.png" />
<link rel="manifest" href="./site.webmanifest" />
<script>
// Register minimal service worker for PWA installability.
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('./sw.js').catch(function() {});
}
// Start critical data fetches before React/Vite JS loads.
// Must be in <head> BEFORE the module script so the browser queues these
// fetches before it discovers and starts downloading the JS bundle.

12
frontend/public/sw.js Normal file
View File

@@ -0,0 +1,12 @@
// Minimal service worker required for PWA installability.
// No caching — this app is network-dependent. All fetches pass through.
self.addEventListener("install", function () {
self.skipWaiting();
});
self.addEventListener("activate", function (event) {
event.waitUntil(self.clients.claim());
});
self.addEventListener("fetch", function () {});