🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Web Development Advanced

What is Service Worker?

A JavaScript file that runs in the background, enabling offline support, push notifications, and background sync for web apps.

Service workers act as programmable network proxies between the browser and server. They intercept network requests, cache resources, and serve cached content when offline. This enables Progressive Web App (PWA) capabilities.

The lifecycle includes registration, installation (cache assets), and activation (clean old caches). The fetch event handler implements caching strategies: cache-first, network-first, stale-while-revalidate. Service workers also enable push notifications and background sync.

Related Terms

WebAssembly (Wasm)
A binary instruction format that enables near-native performance execution of code in web browsers alongside JavaScript.
GraphQL
A query language for APIs that lets clients request exactly the data they need, reducing over-fetching and under-fetching.
Middleware
Software that sits between the request and response in a web application, performing processing like authentication or logging.
HATEOAS
Hypermedia As The Engine Of Application State — a REST constraint where API responses include links to related actions and resources.
Cross-Origin Resource Sharing (CORS)
An HTTP mechanism that allows web pages to request resources from a different domain than the one serving the page.
Web Vitals
Google's metrics for measuring user experience quality, including loading speed, interactivity, and visual stability of web pages.
View All Web Development Terms →