// Cache version — bump this when deploying new static assets // Prod uses stale-while-revalidate (instant nav + offline fallback); the // worktree/test instance (port 3001) is forced network-first below so code // changes always show on reload. Bumping this version evicts the old cache. const CACHE = 'meistertracker-v58'; // Test/worktree instance detection. The worktree server runs on port 3001 // (prod is 3000 / 443). On the worktree we never serve static assets from // cache — otherwise a code change requires SW-unregister gymnastics to show // up. self.location is the SW script URL, so .port is reliable here. const IS_WORKTREE = self.location.port === '3001'; const ASSETS = [ '/', '/styles.css', '/app.js', '/manifest.json', '/icon-192.png', '/icon-512.png', // Vendor libs — pre-cached so the scanner and dashboard chart work on first // offline navigation (sw fetch handler is network-first, so without explicit // pre-caching these wouldn't be in the cache until they'd been fetched once). // P-02: app.js no longer eager-loads these via