
An app that survives the subway, the lift and bad station Wi-Fi. What the service worker does when the network lies, which data to keep locally, how to reconcile it with the server later, and why installing on a device raises the bar for quality.
A PWA is often treated as a checklist: a manifest, an icon, a service worker - and the app "became installable." But installability does not make an interface reliable on a real network, where the connection comes and goes, responses arrive late, and a tab lives for weeks between updates. Offline-first is not a "no network" mode but a failure model: from the start the app treats the network as an unreliable resource and builds its behavior around a local source of truth rather than around a lucky request.
This book assembles a PWA into an engineering system. First - the model: how a PWA differs from the myths, the three data layers, the secure context. Then - the service worker: the lifecycle, registration and scope, install and activate without races, fetch as a programmable proxy. Next - caching: Cache Storage versus the HTTP cache, the strategies (Cache First, Network First, Stale While Revalidate) and the matrix for applying them, precaching, navigation fallback and safe updates. After that - data and synchronization: IndexedDB as a local model, transactions and migrations, quota and eviction, the outbox, Background Sync and conflict resolution. Then - the platform: the manifest, installation, integration and Workbox. At the end - operations: security, testing transitions, debugging, observability and a production playbook.
The material rests on one principle: understand the mechanism instead of memorizing recipes. Where the usual advice is a technique, this book explains why it works, what it costs and when it stops being the right call. Behavior and APIs are checked against MDN documentation, the W3C Service Workers, Web App Manifest and IndexedDB specifications, and web.dev and Workbox material, not against common retellings.
You can read in order - the chapters run from the failure model to the service worker, caching, data and operations - or go straight to the one you need. At the end there is a short glossary of terms and a list of primary sources.