Working with service workers

Service workers! They finally give developers precise control of the network layer by creating a network proxy in JavaScript. Using service workers, you can intercept and modify network resource requests, handle how caching is done, and respond appropriately when the user's network is down.

Let us show, step-by-step, how to set up a service worker and its associated methods.

Get Learn ECMAScript - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.