Add service worker for true offline capability #212

Closed
opened 2026-03-24 04:30:13 +00:00 by Timmy · 3 comments
Owner

Create sw.js that caches all core assets (index.html, app.js, style.css, Three.js CDN). The Nexus should load even when offline. Use cache-first strategy for assets, network-first for API calls. Register in index.html.
Files: sw.js, index.html

Create sw.js that caches all core assets (index.html, app.js, style.css, Three.js CDN). The Nexus should load even when offline. Use cache-first strategy for assets, network-first for API calls. Register in index.html. Files: sw.js, index.html
Timmy added the p1-important3d-world labels 2026-03-24 04:30:13 +00:00
claude self-assigned this 2026-03-24 04:30:20 +00:00
Member

PR created. Added sw.js to implement cache-first strategy for assets and network-first for API calls. Registered the service worker in index.html.

PR created. Added sw.js to implement cache-first strategy for assets and network-first for API calls. Registered the service worker in index.html.
Member

PR created. Added sw.js service worker with cache-first strategy for static assets (index.html, app.js, style.css, manifest.json, ws-client.js, Three.js CDN) and network-first for /api/ routes. The Nexus now loads offline after first visit. Registered in index.html with progressive enhancement (silent fail if SW unsupported).

PR created. Added `sw.js` service worker with cache-first strategy for static assets (index.html, app.js, style.css, manifest.json, ws-client.js, Three.js CDN) and network-first for `/api/` routes. The Nexus now loads offline after first visit. Registered in `index.html` with progressive enhancement (silent fail if SW unsupported).
Member

PR #215 updated with service worker implementation.

Changes:

  • sw.js: Full service worker with cache-first strategy for all static assets and Three.js CDN modules, network-first for /api/ routes, Gitea API calls, and WebSocket upgrades
  • Pre-caches: index.html, app.js, style.css, manifest.json, ws-client.js, and key Three.js CDN modules on install
  • Navigate fallback: returns cached /index.html when offline and page not cached
  • index.html: Registers the service worker on load

The Nexus now loads offline once assets have been cached on first visit.

PR #215 updated with service worker implementation. **Changes:** - `sw.js`: Full service worker with cache-first strategy for all static assets and Three.js CDN modules, network-first for `/api/` routes, Gitea API calls, and WebSocket upgrades - Pre-caches: `index.html`, `app.js`, `style.css`, `manifest.json`, `ws-client.js`, and key Three.js CDN modules on install - Navigate fallback: returns cached `/index.html` when offline and page not cached - `index.html`: Registers the service worker on load The Nexus now loads offline once assets have been cached on first visit.
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/the-nexus#212