🎁 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

HTTP/2
The second major version of HTTP that improves performance through multiplexing, header compression, and server push.
PHP
A widely-used server-side scripting language designed for web development that powers over 75% of websites including WordPress.
Sitemap XML
An XML file that lists all important URLs on a website, helping search engines discover and crawl content efficiently.
Brotli Compression
A modern compression algorithm developed by Google that achieves better compression ratios than Gzip for web content delivery.
WebSocket
A communication protocol that enables full-duplex, real-time data exchange between a browser and server over a single connection.
Server-Sent Events
A server push technology that enables a server to send real-time updates to a browser over a single HTTP connection.
View All Web Development Terms →