Service Worker Libraries

Below is the list of service worker libraries that Workbox provides. Each library serves a specific need and can be used together or on it's own.

workbox

Manages loading modules as needed & provides helper methods.

workbox.core

Alter log levels and change cache names via workbox.core. Contains shared code used by all Workbox libraries.

workbox.precaching

Easily precache a set of files and efficiently manage updates to files.

workbox.routing

Routes requests in your service worker to specific caching strategies or callback functions.

workbox.strategies

A set of runtime caching strategies that will handle responding to a request, normally used with workbox.routing.

workbox.expiration

Removed cached requests based on the number of items in a cache or the age of the cached request.

workbox.backgroundSync

Use background sync to reliably make a network request even if the user if offline.

workbox.googleAnalytics

See how users are interacting with your site when they are offline.

workbox.cacheableResponse

Restrict which requests are cached based on a response's status code or headers.

workbox.broadcastUpdate

Send messages to pages (via Broadcast Channels) when a cache is updated with a new response.

workbox.rangeRequest

This modules provides support for responding to a Range: request using a slice of previously cached data.

workbox.streams

This modules provides support for composing a response from a series of streaming sources.

workbox.navigationPreload

Enable navigation preload, to get a network response for navigation requests faster.

Node Modules

Workbox provides a set of Node modules that make it easy to generate a list of files to precache in your service worker or create a complete service worker that you can use without writing any code.

Workbox CLI

Generate a complete service worker, inject a precache manifest or copy the Workbox files from the command line.

workbox-build

An npm module that can generate a complete service worker, inject a precache manifest and copy the Workbox files.

workbox-webpack-plugin

As part of your Webpack build process add Workbox and precache assets.