feat(offline): implement client-side Service Worker range caching for PMTiles and telemetry #95
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
Problem Statement
As specified in
docs/ARCHITECTURE.md §4.3, field inspectors and disaster response teams (Manggala Agni / BPBD) frequently operate in rural peatland concessions with intermittent or absent cellular network coverage.Currently,
public/sw.jsdoes not exist. All PMTiles vector tile chunks and telemetry requests require active network connectivity. If connection drops, tile requests fail with unhandled fetch errors and the map canvas goes blank.Technical Specification
public/sw.js):/tiles/*.pmtilesand/api/tiles/*HTTP range requests (Range: bytes=X-Y).CacheStoragewith composite cache keys (url + ":" + rangeHeader).HTTP 206 Partial Contentresponse (Content-Range,Content-Length,Content-Type: application/x-protobuf)./api/hotspots,/api/tmat, and/api/healthsnapshots with network-first, cache-fallback strategy.src/components/dashboard/dashboard-client.tsxorsrc/app/layout.tsx.Acceptance Criteria
public/sw.jscreated and registered cleanly on client boot..pmtilesare cached and served offline with 0ms latency.pnpm exec vp check,pnpm test, andpnpm buildpass with zero errors.