1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Does Angular service worker bypass throttling?

Discussão em 'Angular' iniciado por Dean Hiller, Setembro 4, 2025.

  1. Dean Hiller

    Dean Hiller Guest

    I created a small Angular client/Node Express server and in Chrome tools, simulating a 3G to slow down so I can see when page renders, we prefetch in install with Angular service worker. After the 7th row, the page renders and it continues to download others. I created a brand new Chrome for this experience with the 2 commands so no files are in this cache for this Chrome.

    mkdir -p /tmp/chrome-testing2
    /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --user-data-dir=/tmp/chrome-testing2 --no-first-run


    Now, the sequence is:

    1. first 5 lines in pic below
    2. page renders
    3. all the rest

    But if you look closely, I have this very large chunk (lazy in Angular but service worker is set to prefetch - hopefuly async after page load but before user clicks perhaps) and you will see from the picture, over 3G, this huge file chunk-GTZTNXRT.js is downloading very fast, bypassing the 3G throttling 974kb (1 meg almost) in just 3ms. Is the service worker ignoring the throttling somehow in Chrome, perhaps?

    This at least answered my question on prefetch will load Angular lazy chunks in the background after rendering initial page from initial chunks needed immediately (this is good).

    [​IMG]

    Is Angular service worker (and browser service workers) downloading outside the Chrome throttling? Notice the first 5 rows take seconds to download and then after page render and service worker is downloading, all of those are very fast.

    Continue reading...

Compartilhe esta Página