Build an offline-capable progressive web app

8 steps · about 4 h 35 min · Intermediate

  1. Define the progressive enhancement goal (guide, web.dev, 25 min)

    Treat installability and offline support as additions to a working web experience.

  2. Create the web app manifest (guide, web.dev, 35 min)

    Describe the installed identity, start URL, display mode and icons explicitly.

  3. Register a service worker (guide, web.dev, 35 min)

    Understand its scope and event-driven lifecycle before intercepting requests.

  4. Select resources to cache (guide, web.dev, 35 min)

    Separate an application shell from changing content and avoid caching everything indiscriminately.

  5. Serve content with a clear strategy (guide, web.dev, 35 min)

    Choose network-first, cache-first or revalidation behaviour according to freshness needs.

  6. Handle offline data honestly (guide, web.dev, 35 min)

    Queue or block writes deliberately and tell the user when displayed information may be stale.

  7. Manage service-worker updates (guide, web.dev, 35 min)

    Avoid leaving an old worker and a new page bundle in an incompatible state.

  8. 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.