Build an offline-capable progressive web app
8 steps · about 4 h 35 min · Intermediate
- Define the progressive enhancement goal (guide, web.dev, 25 min)
Treat installability and offline support as additions to a working web experience.
- Create the web app manifest (guide, web.dev, 35 min)
Describe the installed identity, start URL, display mode and icons explicitly.
- Register a service worker (guide, web.dev, 35 min)
Understand its scope and event-driven lifecycle before intercepting requests.
- Select resources to cache (guide, web.dev, 35 min)
Separate an application shell from changing content and avoid caching everything indiscriminately.
- Serve content with a clear strategy (guide, web.dev, 35 min)
Choose network-first, cache-first or revalidation behaviour according to freshness needs.
- Handle offline data honestly (guide, web.dev, 35 min)
Queue or block writes deliberately and tell the user when displayed information may be stale.
- Manage service-worker updates (guide, web.dev, 35 min)
Avoid leaving an old worker and a new page bundle in an incompatible state.
- Test installation and offline failure (guide, Chrome for Developers, 40 min)
Inspect the manifest, worker, caches and offline requests while exercising first load and update paths.