Part IV β The Reach Β· Lesson 9.2
Progressive Web Applications (PWAs)
In one lineA website that installs, launches from the home screen, works offline, and receives push.
Where you've seen itTwitter Lite. Installable, offline-capable, and orders of magnitude smaller than the native app.
Diagram
THE THREE REQUIREMENTS β all mandatory
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 1. HTTPS service workers refuse to run β
β anywhere else (3.6) β
β 2. manifest.json name, icons, start_url, display β
β 3. service worker with a fetch handler (9.1) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
browser offers install βββΊ home screen icon βββΊ launches
standalone,
no browser UIMANIFEST β the fields that actually matter
{
"name": "Notes", full name, install prompt
"short_name": "Notes", home screen label (~12 chars)
"start_url": "/?source=pwa", β tag it to measure installs
"display": "standalone", no address bar
"background_color": "#0d0f14", splash screen
"theme_color": "#3b4ee0", OS chrome tint
"icons": [192px, 512px, maskable] β maskable or Android crops it
}CAPABILITY LADDER β progressive means it degrades cleanly
works everywhere ββββββββββββββββββββββββββββββ
β responsive HTML + HTTPS β
ββββββββββββββββββββββββββββββ€
most browsers β offline shell (SW cache) β
ββββββββββββββββββββββββββββββ€
β installable (manifest) β
ββββββββββββββββββββββββββββββ€
varies by platform β push notifications β
β background sync β
β file/share/contacts APIs β
ββββββββββββββββββββββββββββββ
Every layer is optional. Feature-detect; never assume.How it works
- Serve over HTTPS, add
manifest.json, and register a service worker with afetchhandler β that's the installability bar. - Handle the install prompt yourself: capture
beforeinstallprompt, show your own button at a sensible moment, then callprompt(). - Provide maskable icons at 192px and 512px, or Android will crop your logo into a circle badly.
- Design the offline state as a real state β a proper "You're offline, here's what's cached" screen, not a browser error.
- Ask for push permission in context, after the user does something that implies they want it. A prompt on first load gets denied permanently.
Trade-offs
| PWA | Native app |
|---|---|
| No store review, instant updates | Store discovery and trust |
| One codebase, linkable, indexable | Full device API access |
| Tiny install size | Better background execution |
| iOS support is partial | Consistent platform behaviour |
Be honest about iOS: installability and offline work, but push support arrived late and only for installed apps, and storage is evicted more aggressively. Design so that the PWA-only features are enhancements, never the core flow.
Interview angle
"When would you build a PWA instead of a native app?"
- When reach and update speed matter more than deep device integration β content, commerce, tools, internal apps.
- When install friction is the main funnel problem: a link that becomes an app beats a store listing.
- Not when you need background location, tight OS integration, or store-based discovery and billing.
Recap
- HTTPS + manifest + service worker is the whole installability bar.
- Every capability above the shell is progressive β feature-detect and degrade.
- Ask for push in context; a first-load prompt is a permanent denial.