What Is a Service Worker?
A service worker is a script that the browser runs in the background which acts as a network proxy to manage network requests programmatically. It sits between the network and the device and caches content, enabling an offline experience for the user.
In addition to caching data, it can also synchronize API data in the background and add things like push notifications.