Build an offline-first browser app
8 steps · about 4 h 45 min · Intermediate
- Define the offline experience (guide, MDN Web Docs, 30 min)
Decide which actions and content must work without a network before choosing APIs.
- Register a service worker (reference, MDN Web Docs, 35 min)
Place network interception and lifecycle work in the browser's background worker model.
- Cache the application shell (reference, MDN Web Docs, 35 min)
Store versioned static resources while keeping cache failures explicit.
- Choose cache strategies (guide, MDN Web Docs, 40 min)
Match cache-first or network-first behaviour to the freshness needs of each request.
- Store structured local data (reference, MDN Web Docs, 40 min)
Persist records and indexes without blocking the main thread.
- Add an app manifest (reference, MDN Web Docs, 25 min)
Provide the identity and display metadata browsers need for installation.
- Handle updates deliberately (guide, MDN Web Docs, 40 min)
Coordinate installing, waiting and active workers without surprising a user mid-session.
- Test offline and recovery states (guide, Chrome for Developers, 40 min)
Verify first load, repeat load, disconnect, queued work, reconnect and a new release with browser tools.