Skip to content
Tutorials Center
My learning

Topics

Lesson 37 of 37 ยท Projects and Practice

PWA Launch Checklist and Practice

Review a PWA before launch: installability, offline, security and privacy of caches, performance, accessibility, debugging patterns, practice exercises and a self-test.

You now know every layer of a PWA. This final lesson is a review you can reuse before each release: a launch checklist, the security and privacy mistakes that are specific to service workers, a catalog of bugs with their usual causes, and practice exercises. Treat the checklist as a living document in your repository and update it every time a bug teaches you something new.

The launch checklist

Installable

  • Served over HTTPS; manifest linked and valid; id, name, short_name, start_url, scope, display.
  • Icons: 192 and 512 pixels, a maskable icon, an Apple touch icon.
  • theme_color and background_color set; screenshots for the richer install UI.

Reliable

  • A fallback page appears for failed navigations.
  • Every request type has a deliberate strategy; nothing is cached by accident.
  • The app works in airplane mode for the main flow; writes are queued and retried.
  • Updates have a path: uncached sw.js, versioned caches, update toast, kill switch.

Fast

  • LCP under 2.5 s, INP under 200 ms, CLS under 0.1 on real devices.
  • Performance budget enforced in CI.

Engaging

  • Notification permission requested after a user action, with settings to control categories.
  • Push payloads small; dead subscriptions deleted.

Accessible and polite

  • Offline and update states announced to screen readers (role="status").
  • Color contrast and focus visible in standalone mode too, where there is no browser UI.
  • A visible way to go back, because standalone windows have no back button on some platforms.
JS Run the checklist against a config

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The result lists exactly which items need work: the worker script is cached for a day, there is no offline page, one cache name lacks a version and personal data is being cached. Writing your own checks as code makes them repeatable.

Security and privacy

Service workers are powerful, which is why they come with rules and with responsibilities.

  • HTTPS only (localhost excepted). A worker can intercept every request in its scope, so a man in the middle of an HTTP site could own it.
  • Scope the worker. A worker at /app/sw.js controls /app/ only, unless the server sends Service-Worker-Allowed. Keep scope as narrow as the app needs.
  • Do not cache personal or authenticated responses in shared runtime caches, and clear caches and IndexedDB on logout. On a shared device, the next person should not see the previous user's data.
  • Never cache responses with Set-Cookie or Cache-Control: no-store unless you know why.
  • Validate message events. postMessage handlers should check event.source and expected shapes.
  • Cross-origin requests produce opaque responses whose size and status you cannot see. Caching them can fill your quota with unknown amounts of data (each opaque entry is padded in size accounting).
  • Content Security Policy protects the page; scripts imported by the worker must come from trusted origins too.
  • Push: keep the VAPID private key secret; authenticate the subscription endpoint on your server; never send secrets in the payload.
  • Store sensitive data thoughtfully. IndexedDB is not encrypted by the web platform; if you store confidential data offline, minimize it and expire it.

Debugging catalog

Symptom Likely cause Fix
Changes to JS never appear Old worker or old cached file DevTools "Update on reload"; version the cache; hash file names
register fails with a MIME type error Server returns HTML (404 page) for /sw.js Serve the real file with a JavaScript content type
Worker does not control the page on first load No clients.claim() and page loaded before activation Call clients.claim() or reload
Install button never appears Installability criteria unmet or already installed Application panel, Manifest, Installability section
Offline page shows unstyled Its CSS was not precached Add every dependency to the precache list
addAll rejects and install fails One URL returns 404 or redirects Fix the URL list; check status codes
Push works in Chrome but not on iPhone App not added to Home Screen, or iOS under 16.4 Install first, then request permission from a tap
Storage "quota exceeded" Unbounded runtime caches Add max entries and age limits
Page stuck on an old version sw.js served with a long cache lifetime Cache-Control: no-cache on the worker file

A useful habit: reproduce in a fresh profile or incognito window first, then in your normal profile. Differences point to stale state rather than to code.

JS Diagnose from symptoms

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Practice exercises

Work through these in order; each builds a skill from the course.

  1. Fallback: add an offline page to any static site. Verify it appears with the Network tab set to Offline, and that it does not appear for a 404.
  2. Strategies: write a router that serves HTML network-first, images cache-first with a 30-entry limit and an API stale-while-revalidate. Test it with fake caches like the news reader project.
  3. Outbox: extend the notes project so edits create update operations; compact consecutive updates before sending.
  4. Conflict: make the server reject stale baseVersion and show the user a merge screen with both versions.
  5. Update UX: implement the update toast and verify with two deployments that no tab reloads without consent.
  6. Push: subscribe, store the subscription, send a test message with a library, handle 410 by deleting.
  7. Budget: add a Lighthouse CI job that fails when performance drops under 90 or the JS budget is exceeded.
  8. Install: build a polite install banner with a 30-day cool-down and an iOS instruction variant.
  9. Distribution: generate a TWA with Bubblewrap and fix the Digital Asset Links until the address bar disappears.
  10. Teardown: write the kill-switch worker, deploy it to a test site and prove that every client ends up unregistered with empty caches.

Where to go next

  • Revisit what is a PWA and re-read it with fresh eyes: each sentence now maps to code you have written.
  • Learn Workbox to replace hand-written strategies and precaching.
  • Study accessibility in standalone mode and on assistive technology.
  • Follow the Baseline and Chrome status pages to learn which capabilities have reached all browsers.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. A deploy does not reach users. The Network tab shows sw.js served with max-age=86400. What is the fix?

    A cached worker script delays update detection. Keep its URL stable and its HTTP cache lifetime near zero.
  2. 2. Why clear caches and local data on logout?

    Cached personal responses and IndexedDB records outlive the session.
  3. 3. An iPhone user cannot receive push although the code works in Chrome. What do you check first?

    iOS supports web push only for installed web apps on 16.4 and later.
  4. 4. Why are opaque cross-origin responses a storage risk?

    You cannot inspect them, and quota accounting pads each one, so many of them can exhaust storage.
  5. 5. Which practice makes launch reviews repeatable?

    Checks that run automatically catch regressions before users do.

Summary

  • Use a written checklist covering installability, reliability, speed, engagement and accessibility, and automate what you can.
  • Scope the worker, use HTTPS, never cache personal data in shared caches and clear on logout.
  • Most PWA bugs come from stale workers, cached worker files, bad precache lists and unbounded caches.
  • Practice the whole loop: fallback, strategies, outbox, updates, push, budgets, install and distribution.

Next: Back to the Progressive Web Apps course