PWA Offline and Install: Making the App Work When the Network Does Not
Offline Is a Product Decision, Not a Checkbox
A progressive web app that only caches a logo is not offline-capable. Offline means naming which screens still work, which actions queue for later, and what the person sees when the radio drops mid-task. That design is as important as the service worker code.
Install is the same story. Ask for a home screen icon after the app has helped once. An early banner that interrupts the first visit trains people to ignore you.
Cache the path people need to finish, not the entire site by accident.
Amap Infotech
Product & Strategy
Precache the app shell. Runtime-cache the reads that make the main job possible. Never blindly cache authenticated pages without a plan for expiry.
Choose a Caching Strategy on Purpose
App shell files can use a precache so the chrome appears instantly. API GETs for lists and detail pages often use network-first with a cache fallback, or stale-while-revalidate when slightly old data is acceptable. POSTs that change money or records should fail clearly or enter an outbox, not pretend they succeeded.
Version your caches and delete the old ones on activate. A service worker that never cleans up will fill storage and serve ghosts of past releases.
Shell firstPrecache HTML, CSS, and JS needed to render the frame of the app.
Common PWA pattern
OutboxQueue unsafe writes offline and sync when the network returns.
Offline-first practice
PurgeOld cache names must die on service worker activate.
Service worker hygiene
Install Without Begging
Meet installability criteria in the browsers you care about, then trigger your own UI after a success moment: first report saved, first order tracked, first lesson completed. Explain what install gives them: faster open, offline reading, fewer browser chrome distractions.
Support an update flow. When a new service worker waits, tell returning users that a fresh version is ready, then reload on their say-so. Silent swaps can confuse people mid-form.
Install prompt tied to a completed job, not first paint
Manifest icons and display mode tested on Android and desktop
Update toast with a clear reload action
Storage estimates checked so large media caches do not surprise you
Fallback pages for offline navigation misses
Test the Broken Network on Purpose
Use airplane mode, slow 3G throttling, and flaky profiles in DevTools. Walk the main job end to end. Confirm queued actions flush once. Confirm logout and token expiry still behave when cached HTML appears.
Track offline session starts, successful syncs, and failed syncs that need a person. Those numbers tell you whether offline is helping or creating support tickets.
53%Of mobile visits leave slow pages. Offline shells still need a fast first paint when online.
Google research on mobile speed
Slow 3GA required QA profile for any PWA that claims field use.
Practical mobile testing
Sync %Measure how often queued offline actions succeed later.
Offline operations metric
Make Offline Trustworthy
PWA offline and install features work when the product team decides what still functions without a network, and when updates stay under the user’s control. Cache with intent, prompt install after value, and test the broken radio like it is a primary device.