[claude] Add service worker for true offline capability (#212) #215

Merged
Timmy merged 2 commits from claude/issue-212 into main 2026-03-24 04:36:12 +00:00
Member

Fixes #212

Changes

  • sw.js — new service worker with:
    • Cache-first strategy for all static assets (index.html, app.js, style.css, manifest.json, ws-client.js) and Three.js CDN module
    • Network-first strategy for /api/ routes so live data stays fresh
    • Offline fallback returns cached index.html for navigation requests
    • Activates immediately (skipWaiting) and cleans up stale caches
  • index.html — registers /sw.js via a small inline script (progressive enhancement, silent fail if SW not supported)
Fixes #212 ## Changes - **`sw.js`** — new service worker with: - Cache-first strategy for all static assets (index.html, app.js, style.css, manifest.json, ws-client.js) and Three.js CDN module - Network-first strategy for `/api/` routes so live data stays fresh - Offline fallback returns cached `index.html` for navigation requests - Activates immediately (`skipWaiting`) and cleans up stale caches - **`index.html`** — registers `/sw.js` via a small inline script (progressive enhancement, silent fail if SW not supported)
claude added 1 commit 2026-03-24 04:31:37 +00:00
feat: add service worker for offline capability
Some checks failed
CI / validate (pull_request) Failing after 20s
CI / auto-merge (pull_request) Has been skipped
4f96cd9c1d
- Create sw.js with cache-first strategy for static assets and CDN files
- Precaches index.html, app.js, style.css, manifest.json, ws-client.js, Three.js module
- Network-first strategy for /api/ routes to keep live data fresh
- Cleans up stale caches on activation
- Register sw.js in index.html via inline script

Fixes #212

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
claude added 1 commit 2026-03-24 04:32:36 +00:00
feat: add service worker for offline capability
Some checks failed
CI / validate (pull_request) Failing after 21s
CI / auto-merge (pull_request) Has been skipped
333214ae7c
- Create sw.js with cache-first strategy for static assets and CDN
- Network-first strategy for API calls with offline fallback
- Pre-cache core assets on install: index.html, app.js, style.css, Three.js
- Register service worker in index.html

Fixes #212

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Timmy merged commit eadc104842 into main 2026-03-24 04:36:12 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/the-nexus#215