HeadlinesBriefing favicon HeadlinesBriefing.com

When Service Workers Aren’t Worth the Hassle

Hacker News •
×

Neciu recently dissected service‑worker use cases, prompting a quick flashback for many developers. In a recent survey, two respondents recalled deploying a worker in 2019, then removing it after a bad cache strategy served stale assets and forced a killswitch rollout that took days to propagate. Early adopters, including the author, have hit similar breakage, highlighting how workers can complicate update flows.

Slack’s instant‑boot technique caches the full asset bundle and rehydrates Redux state so the UI appears before any network request. Since assets rarely change, a standard HTTP cache with content‑hashed filenames and long‑term immutable headers would serve them directly. Vercel’s skew‑protection addresses the “dead chunk” issue where a new deploy invalidates a cached bundle, yet caching the entire app via a worker nullifies code‑splitting gains.

Mux solves manifest rewriting by moving the logic to the server, avoiding the client‑side race where a video player fetches before a worker takes control. Deploying the same fetch‑event code to Cloudflare Workers provides a stable URL without extra bandwidth. Partytown’s service‑worker fallback and Mock Service Worker illustrate niche scenarios, but offline support, push notifications and background sync remain the only truly unique service‑worker capabilities.