Growth Marketing Glossary

Service Worker

ser·vice work·ernoun

The browser's background script. A service worker sits between a web app and the network, caching content for offline use and powering push, even when no page is open.

web page requestsproxy in the backgroundoffline and push power
Schematic — a background proxy between a web app and the network
Term
Service worker
Is
A background browser script and network proxy
Enables
Offline use, caching, push notifications
Powers
Progressive web apps and silent push

Parts of speech & senses

service worker · noun
  1. A service worker is an event-driven script that a browser runs in the background, independent of any web page, intercepting network requests to enable offline access, caching, and push notifications. "The service worker cached the app shell so it loaded instantly offline."

What a service worker is

A service worker is a small script that a web browser runs in the background, separate from the web page itself. Ordinary JavaScript runs inside a page and dies when the tab closes; a service worker lives outside any single page and can keep working even when no tab is open. Its defining power is that it acts as a programmable network proxy: it can intercept the requests a site makes, for pages, images, or data, and decide how to answer them, serving a cached copy, fetching from the network, or combining both. That interception is what unlocks offline behavior. Once a service worker has cached the core files of a web app, the app can load and function without a connection, because the service worker answers the requests locally instead of failing. It is the engine underneath progressive web apps, or PWAs, which are websites that behave more like installed applications.

Service workers are event-driven, meaning they wake up to handle specific events and go dormant otherwise, which keeps them light. Two of those events matter most to marketers. The first is fetch, where the worker intercepts network requests and applies a caching strategy, making pages load fast and work offline. The second is push, which lets the worker receive a message from a server and show a notification even when the user is not on the site, the mechanism behind web push notifications. Because a service worker runs in the background and persists beyond the page, it can also power silent updates, syncing data or refreshing caches without the user doing anything. That persistence is exactly what makes it useful and what makes it worth understanding: it is code that keeps running when the page is gone.

Service worker versus web worker

A service worker is easy to confuse with a web worker, and the names do not help, but they do different jobs. A web worker is a background thread whose purpose is to run heavy computation off the main thread so the page stays responsive, crunching numbers, parsing large files, or processing images without freezing the interface. It has no special relationship to the network and no life beyond the page that created it; close the page and the web worker is gone. A service worker is a specialized kind of background script whose whole point is to sit between the app and the network as a proxy, handling requests, caching, and push. One is about computation; the other is about the network and persistence.

The practical differences follow from that. A web worker cannot intercept network requests or serve content offline; a service worker can, and that is its main reason to exist. A web worker lives and dies with its page; a service worker outlives the page, which is what lets it receive push notifications and run background sync when no tab is open. So if the goal is to keep a busy interface smooth during a big calculation, reach for a web worker. If the goal is to make a site load offline, cache assets intelligently, or send push notifications, you need a service worker. They can coexist in the same app doing their separate jobs, but treating one as a substitute for the other leads straight to disappointment, since a web worker will never make your site work offline, and a service worker is the wrong place to run pure number-crunching.

Using service workers well

Service workers are powerful precisely because they intercept the network, which is also why they demand care. They only run over HTTPS, with localhost as the exception, a deliberate security requirement, since a script that can rewrite every network response could be dangerous over an insecure connection. The trickiest part is caching strategy: decide clearly what to serve from cache, what to fetch fresh, and how to update stale content, or users will see outdated pages long after you have shipped new ones. A stale or buggy service worker is a classic hard-to-diagnose problem, because it can keep serving old files from cache while you wonder why your changes are not appearing. Versioning caches and cleaning up old ones on update is essential discipline, not an afterthought.

For marketers, the value is concrete: faster repeat visits, resilient offline experiences, installable web apps, and, used honestly, web push as a re-engagement channel. Note the honesty point. Because a service worker can show push notifications even when the user is not on your site, it is easy to abuse, and browsers and users push back hard against sites that beg for notification permission on arrival or spam alerts. Ask for push permission in context, after you have earned it, and send notifications people actually want. The failures to avoid are caching that serves stale content, requesting push permission too aggressively, assuming support everywhere when older or restricted environments differ, and confusing a service worker with a web worker. Treated as the careful, offline-and-push proxy it is, a service worker meaningfully improves speed and re-engagement.

Worked example. A news publisher wants its mobile site to feel as fast and reliable as an app. It adds a service worker that caches the site's shell, meaning the layout, styles, and core scripts, on the first visit. On later visits the service worker answers those requests from cache, so the page paints almost instantly and even opens when the reader is on a train with no signal, showing previously loaded articles. Later, with permission granted in context after a few visits, the same worker delivers a breaking-news push. The lesson: the service worker acted as a background network proxy to enable offline access, faster loads, and push, jobs a web worker could never do because it neither touches the network nor outlives the page. (Illustrative; RGM analysis.)
Failure modes to watch. Shipping a caching strategy that serves stale content so users never see updates; requesting push-notification permission on arrival and abusing it; assuming service workers are supported and behave identically everywhere; and confusing a service worker, a network proxy, with a web worker, a computation thread.

Synonyms & antonyms

Synonyms

background browser scriptPWA service workernetwork proxy script

Antonyms

web workerinline page script

Origin & history

The name reuses the software idea of a worker, a background process, and service, its role standing between an app and the network.

Etymology: source.

Usage trends

Search interest for this term over the last five years:

View interest-over-time on Google Trends →

Common questions

What is a service worker?
A service worker is a script the browser runs in the background, separate from any web page. It works as a programmable network proxy, intercepting requests to enable offline access, caching, and push notifications, and it powers progressive web apps by continuing to run even when no tab is open.
How is a service worker different from a web worker?
A web worker runs heavy computation off the main thread to keep a page responsive and dies with the page. A service worker acts as a network proxy for caching, offline, and push, and outlives the page. One is about computation, the other about the network.
Do service workers power push notifications?
Yes. Because a service worker runs in the background and persists beyond the page, it can receive push messages from a server and show notifications even when the user is not on the site. That same power is easily abused, so ask for permission in context.

Resources & people to follow

Curated, non-competitor resources verified per term.

Related training

Disciplines

Areas of marketing where service worker is a core concern:

Sources

  1. trendsGoogle Trends — "service worker"