Service Worker and Offline

"/home/yossef/notes/git/projects/maplibra/modules/Service Worker and Offline.md"

path: maplibra/modules/Service Worker and Offline.md

- **fileName**: Service Worker and Offline
- **Created on**: 2026-06-16 00:48:42

Service Worker and Offline

Purpose: App-side service worker registration, public worker file, and offline manifest.

Related: ../Home.md, ./Android Bridge.md, ./Offline Basemaps and PMTiles.md, ../risks/Offline Packaging Risks.md

Migrated from: obs_vault

What It Does

The app registers a service worker in production to cache assets for offline use. The service worker uses an offline-assets.json manifest to pre-cache essential files.

Service Worker Registration

src/app/service-worker.js handles registration:

Public Service Worker

public/sw.js (the actual service worker file):

Offline Manifest

offline-assets.json lists all assets that should be pre-cached:

Important Files

How It Connects