on-internet
← Community

Why network-first strategy is slower than no service worker?

Stack Overflow ·

While benchmarking performance of service worker with workbox, we found an interesting phenomena. When service worker is applied, network-first strategy of workbox takes about 30 ms slower than no service worker networking. Then, we tried to skip workbox and implement network-first strategy manually, it is about 20ms slower. My guess is that, if service worker kicks in, all request has to be handled by javascript code. It is the execution of JavaScript code that make the networking slower. Then, I checked cache-first strategy, it turns out that fetching content from cache-storage is slower tha

Comments

Sign in or sign up to comment and upvote.

No comments yet.