# Service worker

> A script the browser runs between your page and the network — intercepts requests to cache, serve offline and sync in the background.

Registered once, the service worker sits in the request path: the page asks, the worker decides — cache first, network first, or a hand-built fallback when offline. That middle position is what makes offline-capable web apps possible and what makes PWAs more than a manifest.

The power comes with the classic footgun: a worker caching too aggressively serves a stale site to users who cannot fix it with refresh — the worker controls the refresh too. Versioned caches and a deliberate update flow are the price of the superpower.

## Related terms

- https://dfieldsolutions.com/en/glossary/pwa.md
- https://dfieldsolutions.com/en/glossary/http-caching.md
- https://dfieldsolutions.com/en/glossary/client-side-rendering.md

---

Source: https://dfieldsolutions.com/en/glossary/service-worker
DField Solutions — Dunakeszi, Hungary — dezso@dfieldsolutions.com
Booking: see https://dfieldsolutions.com/en/contact
