Add service worker for true offline capability #212
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
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.jsservice 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 inindex.htmlwith progressive enhancement (silent fail if SW unsupported).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 upgradesindex.html,app.js,style.css,manifest.json,ws-client.js, and key Three.js CDN modules on install/index.htmlwhen offline and page not cachedindex.html: Registers the service worker on loadThe Nexus now loads offline once assets have been cached on first visit.