--- title: "Offline support and service workers" category: resilience status: optional url: https://webspecification.com/spec/resilience/offline-support/ updated: "2026-07-09T00:00:00.000Z" sources: - title: "MDN — Service Worker API" url: "https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API" publisher: "MDN" - title: "MDN — Using Service Workers" url: "https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers" publisher: "MDN" - title: "web.dev — Common techniques to build offline applications" url: "https://web.dev/articles/offline-cookbook" publisher: "web.dev" - title: "W3C — Service Workers" url: "https://www.w3.org/TR/service-workers/" publisher: "W3C" source_repo: undefined licence: CC-BY-4.0 --- # Offline support and service workers > A service worker can serve a cached offline fallback page when the network fails, keeping the site usable on flaky connections and turning hard failures into graceful ones. ## What it is A service worker is a JavaScript file that the browser runs in the background, separate from any page. It sits between the page and the network and can intercept requests, return cached responses, and respond when the network is unavailable. The minimum useful offline feature is a single cached fallback page that the worker serves when a navigation request fails. A service worker is not an ordinary script. A normal `