What is a Service Worker?
A Service Worker is a JavaScript file that runs separately from the main browser thread. It intercepts network requests, allowing you to cache assets locally, serve offline fallback pages, and handle background synchronization or push notifications. It is the core technology that makes a Progressive Web App (PWA) work offline.