This page contains examples for some of the Workbox modules.

Workbox is a set of small modules that can be used on their own, but we've also combined the most common pieces into one module, workbox-sw. This module supports precaching, routing of fetch events, runtime caching and more.


The workbox-sw example demonstrates a complete service worker implementation, demonstrating the common parts of the API. It's an in-depth exploration of everything you'd need to build a production-ready service worker.

View Example

Lower Level Modules

As an alternative to using the full workbox-sw library, you can use these smaller, standalone modules in your service worker.


Uses the Broadcast Channel API to let you know when two responses are different.

View Example


Takes care of expiring cached entries based on the maximum number or age of entries.

View Example


Makes it easy to handle network requests using the response strategy of your choice.

View Example


Implements common cache strategies, and provides hooks to extend the default behaviors.

View Example