Menu

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

closed
nobody
2021-01-20
2021-01-18
Anonymous
No

Originally created by: BezMaster

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

Discussion

  • Anonymous

    Anonymous - 2021-01-19

    Ticket changed by: jeffposnick

    • status: open --> closed
     
  • Anonymous

    Anonymous - 2021-01-19

    Originally posted by: jeffposnick

    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].

     

    Related

    Tickets: #2528

  • Anonymous

    Anonymous - 2021-01-20

    Originally posted by: BezMaster

    @jeffposnick Thanks a lot for your explanation ;)

     

Log in to post a comment.