A web app that installs to the home screen, runs offline, sends push notifications, and feels like a native app — without an app store. The middle path between web and native.
← Back to Client SideRequired. Service workers, push notifications, geolocation, camera, and most modern APIs are gated on a secure context (localhost exempted for dev).
A small JSON file linked from your HTML that tells the OS how to install the app: name, icons, theme color, start URL, display mode (standalone hides the browser chrome), screenshots for the install card.
{
"name": "My App",
"short_name": "My App",
"start_url": "/",
"display": "standalone",
"theme_color": "#1a4d8c",
"background_color": "#ffffff",
"icons": [
{ "src": "/icon-192.png", "sizes": "192x192", "type": "image/png" },
{ "src": "/icon-512.png", "sizes": "512x512", "type": "image/png" }
]
}
A script that runs in a separate worker thread, intercepts network requests, and can serve from cache when offline. Acts as a programmable proxy between the page and the network.
install (cache app shell) → activate (clean old caches) → fetch (intercept requests).postMessage.| Strategy | What it does | Use for |
|---|---|---|
| Cache First | Serve from cache, fall back to network | Static assets, fonts, app shell |
| Network First | Try network, fall back to cache | API responses where freshness matters |
| Stale While Revalidate | Serve cache immediately, refresh in background | Feeds, dashboards — fast and eventually fresh |
| Network Only | Always go to network | POSTs, analytics, anything mutating |
| Cache Only | Never hit network | Pre-cached offline content |
Workbox (Google) is the de-facto library for writing service workers — handles routing, strategies, precaching, and updates.
| Wrapper | Target | How |
|---|---|---|
| TWA — Trusted Web Activity | Google Play | Android shell that opens your PWA fullscreen via Chrome Custom Tabs. |
| PWA Builder | Play, Microsoft Store, App Store | Microsoft tool that generates wrapper projects from a manifest URL. |
| Capacitor | iOS, Android, Web | Native shell with JS bridge; full access to native APIs from the same web codebase. |
Add a manifest + service worker. Big ROI for low effort.
Web + PWA gets you a 0% cut and instant updates.
PWAs are perfect — no MDM-store friction, deploy via URL.
Pick native or Capacitor — PWA alone won't reach widgets / HealthKit / Live Activities.
fetch handlers can serve stale HTML and break updates.