Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workbox migration from 5.1.3 to 6.0.2 (precache installation time increases a lot in 6.0.2) #2731

Closed
BezMaster opened this issue Jan 18, 2021 · 2 comments

Comments

@BezMaster
Copy link

Library Affected:

  • "workbox-6.0.2"

workbox-sw, workbox-build, etc.

  • "workbox-cli": "^6.0.2",
  • "workbox-core": "^6.0.2",
  • "workbox-precaching": "^6.0.2",
  • "workbox-sw": "^6.0.2",
  • "workbox-webpack-plugin": "^6.0.2",

Browser & Platform:
Version 81.0.4044.92 (Build officiel) (64 bits) & Linux Ubuntu 18.04.4 LTS

Issue or Feature Request Description:
Migration from Workbox 5.1.3 to 6.0.2

I have an issue with the new workbox 6.0.2 version.
I call the same functions as before in version 5.1.3 in my sw.js. It works fine.

But the precache installation duration is 5 times longer with 6.0.2. I don't understand why.

Is there a way to have the same precache installation speed than in 5.1.3 ?
Is there a good reason to justify this difference ?

You can find a sample of my sw.js just there

import { cleanupOutdatedCaches,  precacheAndRoute} from 'workbox-precaching';
import { clientsClaim, setCacheNameDetails, skipWaiting } from 'workbox-core';

const precacheList = self.__WB_MANIFEST || [];
setCacheNameDetails({
  prefix: 'test',
  suffix: 'v1',
  precache: 'precache',
  runtime: 'runtime'
});
clientsClaim();
skipWaiting();

precacheAndRoute(precacheList)
cleanupOutdatedCaches();


Thanks a lot

@BezMaster BezMaster changed the title Workbox 5.1.3 to 6.0.2 precache installation time increases a lot in 6.0.2 Workbox migration from 5.1.3 to 6.0.2 (precache installation time increases a lot in 6.0.2) Jan 18, 2021
@jeffposnick
Copy link
Contributor

What you describe sounds intentional, due to this change:

workbox-precaching has been updated so that only one entry in the precache manifest is requested and cached at a time, instead of attempting to request and cache all of them at once (leaving it to the browser to figure out how to throttle).

This should reduce the likelihood of net::ERR_INSUFFICIENT_RESOURCES errors while precaching, and also should reduce the bandwidth contention between precaching and simultaneous requests made by the web app.

See #2528.

@BezMaster
Copy link
Author

@jeffposnick Thanks a lot for your explanation ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants