A service worker is a script that your browser runs in the background, separate from a web page, opening the door to features that don't need a web page or user interaction. ... Before service worker, there was one other API that gave users an offline experience on the web called AppCache.