16. Remove Service Worker and PWA
Status
Accepted — 2026-04-24
Supersedes ADR 0011
Context
The Angular service worker update mechanism (SwUpdate) was unreliable in production. The VERSION_READY event did not fire consistently, leaving users stranded on stale cached versions with no prompt to reload. The freshness-first navigation strategy (ADR 0011) mitigated some staleness but did not eliminate it — a broken worker registration could still strand readers indefinitely.
The PWA install prompt added UX friction without delivering proportional value. A satirical blog does not benefit from home-screen installation or offline reading in the way a productivity app would. The install banner interrupted the reading experience and was dismissed by nearly every visitor.
The new-post polling notification (NewPostService) is independent of the service worker — it fetches the posts manifest via fetch() and compares against localStorage. It remains in place.
Decision
Remove all service worker registration, caching configuration, and PWA metadata. The site operates as a standard web application.
Removed: - provideServiceWorker() from app.config.ts - ngsw-config.json - manifest.webmanifest - SwUpdateService and SwUpdateToastComponent - InstallPromptComponent - @angular/service-worker dependency - PWA-specific meta tags (manifest, apple-touch-icon, mobile-web-app-capable, apple-mobile-web-app-status-bar-style) - ngsw.json cache header rule from firebase.json
Retained: - theme-color meta tags (browser chrome styling, useful without PWA) - NewPostService and NewPostToastComponent (manifest polling, no SW dependency) - sw_poll_interval_ms Remote Config key (still used by NewPostService) - Icon files in assets/icons/ (icon-512x512.png is used by JSON-LD SITE_LOGO)
Consequences
- No offline support. The site requires a network connection to load. For a publishing site with no offline editing or critical workflows, this is acceptable.
- Content is always fresh from the network on every navigation. No caching layer can serve stale HTML.
- Eliminates the class of bugs where a broken or stuck service worker registration strands users on an old version.
- Removes the install banner, eliminating a source of UX friction for first-time visitors.
- The
jjk-install-dismissedandjjk-last-post-urllocalStorage keys become orphaned on existing users’ browsers. They are small string values and harmless to leave. - Existing users who previously installed the PWA will still have it on their home screen. The app will continue to work as a normal web page but will no longer receive service worker updates. They may need to manually remove the old service worker via browser DevTools if caching issues persist.
- Re-adding a service worker later would require re-implementing the registration, caching config, and update flow from scratch.