service worker

/SUR-vis WUR-ker/ · noun · Development · Origin: 2014

Definitions

  1. A JavaScript file that runs in the background of a web page, acting as a programmable network proxy between the browser and the server. Service workers enable offline functionality, push notifications, and background sync by intercepting and caching network requests. They cannot access the DOM directly and communicate with pages via the postMessage API.

    In plain English: A background script in your browser that can intercept network requests and cache pages, making websites work offline and load faster on repeat visits.

    Example: The service worker cached all the critical assets on first visit, so the app loads instantly on repeat visits even without an internet connection.

Related Terms