Download Latest Version Workbox v7.4.1 source code.zip (1.5 MB)
Email in envelope

Get an email when there's a new version of workbox

Home / v2.1.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2017-10-05 1.4 kB
Workbox 2.1.0 source code.tar.gz 2017-10-05 294.7 kB
Workbox 2.1.0 source code.zip 2017-10-05 533.7 kB
Totals: 3 Items   829.8 kB 0

What's new?

The 2.1.0 release fixes a longstanding issue in workbox-sw that could cause routes established via router.registerRoute() to inadvertently take precedence over the internal route that is intended for precached assets.

As described in this issue, the impacted code might look like:

:::js
// The internal route to serve the precached assets *should* have
// taken precedence... but prior to the 2.1.0 release, it didn't.
workboxSW.precache([]);

// This is a very broad wildcard match!
// Previously, it would cause precached assets to be served network-first.
// As of the 2.1.0 release, it will no longer apply to precached assets.
workboxSW.router.registerRoute(
  '/*',
  workboxSW.strategies.networkFirst()
);

Our documentation states that precached assets are always served via a cache-first route, so this previous behavior is considered a bug.

If, for some reason, your service worker depended on this buggy behavior, please update your code prior to upgrading to 2.1.0.

Bug Fixes

Source: README.md, updated 2017-10-05