5.0.0
What's New?
The 5.0.0
release includes a number of significant changes, including one that will require all existing caches to be repopulated with fresh entries.
Accommodate Restrictions Around Redirected Responses for Navigations
As described in more detail in this issue, browsers have imposed an additional restriction that prevents a service worker from responding to a navigation request with a response that was obtained via a redirect.
In practice, this is unlikely to affect most sw-precache
users, but it did affect some who explicitly had HTTP redirects set up covering their /
and /index.html
URLs.
To accommodate this new restriction, sw-precache
will now create a "clean" copy of any redirected responses prior to added them to its caches. The 5.0.0
release of sw-precache
will impose a one-time repopulation all of its caches after you deploy an updated service worker, and those new cached entries will contain "clean" entries for redirected responses.
Require node v4.0.0 or Higher
node versions less than 4.0.0
are now officially end-of-lifed, and we have dropped support for them in the latest sw-precache
release. In practice, that means we've been able to update some dependencies in our package.json
to point to newer releases that in turn required node 4.0.0
.
Perform the dontCacheBustUrlsMatching
check against the URL's path
This was always the intentional behavior, but previously developers who used dontCacheBustUrlsMatching
would find that the regular expression was applied to the full URL, including the hostname. As of this latest release, the regular expression is only applied to the URL's path, so that it could pick up versioning information that's explicitly included in the file names of resources.
Add update-notifier
to the CLI
To notify users of the CLI about new releases moving forward, we've added update-notifier
to the CLI.
PRs Since Previous Release
- Add a react starter kit in readme
- "Clean up" redirected responses
- Update to require at least node 4.0.0.
- Match the cache-bust check against the URL's pathname
- Adds update-notifier to the CLI
Thanks
Thanks to @bertho-zero for their contributions!