Glossary · protocol

What is Service worker?

A service worker is a script that runs in the background of a website, separate from the main page, intercepting network requests and providing offline support. Modern YouTube uses service workers heavily for caching, background sync, and notifications. They are also why "clearing site data" sometimes is the only fix for stuck YouTube state.

Also called:serviceworker · sw · web worker

A service worker installs into the browser the first time you visit a site. After that, it can intercept every network request from that site (or specific patterns), serving from cache if available, fetching from network if not. This is what makes YouTube's navigation feel instant — recently viewed pages are cached.

The downside: a corrupted service worker can cache broken state. A YouTube page that's "stuck on loading" sometimes has a service worker returning a stale, broken version. Clearing site data in DevTools (Application → Storage → Clear site data) removes the service worker, which fixes it.

For VidPickr: we don't register a service worker because the architecture is intentionally simple (server-side rendering + client-side hydration). The StreamSaver fallback library does register one as part of its offline-save trick, but it's scoped to mitm subdomain and doesn't affect normal navigation.

Common questions

What does "clear site data" actually do?
It removes cookies, cache, IndexedDB, local storage, service workers, and any other persistent data the site has stored in the browser. Equivalent to "fresh install" for that one site — re-creates everything on next visit.

Related terms

VidPickr is a free, browser-based YouTube downloader. Every term in this glossary either describes how YouTube delivers video or why your downloads behave the way they do. Try the downloader →