question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

transferSize reported as 0 on mainThread when StaleWhileRevalidate has a cache miss and hits network

See original GitHub issue

Library Affected: workbox-strategies v4.3.1

Browser & Platform: all browsers.

Issue: transferSize reported as 0 on mainThread when StaleWhileRevalidate has a cache miss and hits network:

I manually deleted the entire cache and reloaded the page. image

If it hits cache, the numbers are as below. image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
philipwaltoncommented, May 11, 2020

Yep, event.clientId will not not be set for navigation requests, as the client doesn’t exist yet.

1reaction
philipwaltoncommented, May 11, 2020

The fetch event that initiated the navigation should have a resultingClientId property, which can be used to later match against the Clients API in the service worker.

Unfortunately, not all browsers support this property, but here’s some code we use in Workbox to deal with that (that use can use as an example): https://github.com/GoogleChrome/workbox/blob/04ba6442c466d2e8197fe586672143d201af3a61/packages/workbox-core/src/_private/resultingClientExists.ts

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's a Cache Miss? Policies That Reduce ... - Hazelcast
A cache miss occurs when a system or application makes a request to retrieve data from a cache, but that specific data is...
Read more >
Cache Miss – What It Is and How to Reduce It
Cache miss suggests that requested data is not available in cache memory. Read on to learn how to reduce them and make the...
Read more >
How to calculate L1 and L2 cache miss rate?
Hello, everyone: I am a new user of Intel Vtune. I want to measure the L1 and L2 cache miss rate on intel...
Read more >
What is a cache hit ratio? - Cloudflare
A cache hit ratio is calculated by dividing the number of cache hits by the total number of cache hits and misses, and...
Read more >
What are Hit and Miss Ratios? Learn how to calculate them!
Did you know you can find out how well your cache is performing by calculating hit and miss ratios in caches? Here's how...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found