Explain Progressive Web Apps (PWAs) and their benefits.
A PWA is a web app that uses a service worker, web app manifest, and HTTPS to behave like a native app — installable, offline-capable, push notifications, fast repeat loads. Benefits: reach + install without an app store, offline resilience, one codebase. Limits: less OS integration than native.
A PWA is a regular web app enhanced with three core technologies so it behaves like a native app.
The three pillars
1. Service Worker — a script that runs in the background, separate from the page, acting as a programmable network proxy. It enables:
- Offline support — cache the app shell and data; serve from cache when the network is down.
- Caching strategies — cache-first, network-first, stale-while-revalidate.
- Background sync and push notifications.
2. Web App Manifest — a JSON file (name, icons, theme color, display: standalone, start URL) that makes the app installable to the home screen and launchable in its own window without browser chrome.
3. HTTPS — required; service workers only run on secure origins (powerful APIs, so they must be secure).
Benefits
- Installable without an app store — no review process, no 30% cut, instant updates. Users "Add to Home Screen."
- Offline & flaky-network resilience — works on the subway, in elevators, on bad connections.
- Fast repeat visits — cached shell loads instantly.
- Push notifications & re-engagement — even when the app is closed (on supported platforms).
- One codebase, all platforms — no separate iOS/Android builds.
- Discoverable & linkable — it's still the web: indexed by search, shareable by URL.
- Smaller footprint than native installs.
Limitations (be honest)
- Less OS/hardware integration than native — limited or no access to some sensors, contacts, deep background processing.
- iOS support lags — Apple's PWA support is partial and has historically been restricted (push, install UX, storage limits).
- Not in the app store by default — some users only look there (though you can wrap a PWA for store distribution).
- Discoverability/trust — users may not know to "install" a website.
The framing
"A PWA is a normal web app plus three things: a service worker for offline and caching, a manifest to make it installable, and HTTPS. The payoff is native-like UX — installable to the home screen with no app store, works offline, fast repeat loads, push notifications — from a single web codebase. The trade-off is less OS and hardware integration than true native, and historically patchy iOS support. It's ideal when reach and a single codebase matter more than deep device features."
Follow-up questions
- •What caching strategies can a service worker use?
- •Why must a PWA be served over HTTPS?
- •What can native apps do that PWAs still can't?
- •How does a service worker handle app updates?
Common mistakes
- •Thinking a PWA is just 'a website with an icon' — the service worker is the core.
- •Forgetting HTTPS is mandatory.
- •Claiming full parity with native — OS integration is limited.
- •Ignoring service-worker update/versioning pitfalls (stale caches).
Performance considerations
- •Service-worker caching makes repeat loads near-instant and reduces server load, but a misconfigured cache serves stale code. Use versioned caches and a sensible strategy (stale-while-revalidate for assets, network-first for data).
Edge cases
- •A stale service worker serving outdated cached assets after a deploy.
- •iOS storage limits evicting the cache.
- •First visit can't be offline — the SW isn't installed yet.
- •Updating a service worker requires careful skipWaiting/clientsClaim handling.
Real-world examples
- •Twitter Lite, Starbucks, and Spotify's web players ship as PWAs.
- •News and e-commerce sites using PWAs for offline reading and fast repeat visits.