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.

Cache not invalidates

See original GitHub issue

Descriptiion

on my setup the cache not invalidates correct.

symptom i faced

this results in some “errors” because of stale cache:

  • #3324 Bug at "Shows PRs that touch the current file."?
  • #3301 Feature Request: on an 404 with master try to redirect to main
  • show-associated-branch-prs-on-fork shows old data after 2 days

Suggested: page refresh

source https://github.com/sindresorhus/refined-github/issues/3302#issuecomment-662129283

 maxAge: 1 / 2, 
 staleWhileRevalidate: 4, 

staleWhileRevalidate means that you’ll see cached data for 4 days after it expires (half a day), but one more page refresh will show the latest information.

i have done the page reload (<kbd>⌘</kbd>+<kbd>r</kbd>) and hard reload (<kbd>⌘</kbd>+<kbd>⇧</kbd>+<kbd>r</kbd>) many times before i reported an issue here.

How can i help

  • is there a way to track this problem?
  • how can i help to find the cause of the cache problem?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
fregantecommented, Jul 22, 2020
  1. Run await browser.storage.local.get() in the extension console context
  2. Yes. The first load after the expiration date will show the cached data, but also trigger the API request which updates the cache. The second load will use this new cache.
1reaction
fregantecommented, Jul 22, 2020

Please stop opening more issues about the cache.

I just verified that it works exactly as expected:

  • I had bugs-tab with this cached data: { data: 20, maxAge: 1595771254270 }
  • That maxAge is in 4 days and 13 minutes (bugs-tab is set to expire in 30 minutes + 4 days)
  1. I waited those 13 minutes
  2. I refreshed this page
  3. The tab still reported 20 because of the staleWhileRevalidate behavior
  4. I refreshed this page
  5. The tab reported 21 and the cached object was { data: 21, maxAge: 1595773212201 }, which is 4 days and 28 minutes
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Cache Invalidation Doesn't Work | by Ben Brazier
Invalidating the cache at the CDN level doesn't have any impact on the users browser or Internet Service Provider (ISP) caching. This means...
Read more >
Cache made consistent: Meta's cache invalidation solution
Cache invalidation describes the process of actively invalidating stale cache entries when data in the source of truth mutates.
Read more >
When and How to Invalidate Cache - Lu's blog
Cache invalidation, then, is an attempt to strengthen some of the properties, without introducing the same level of coordination as the "primary ...
Read more >
What is cache invalidation? - Varnish Software
Cache invalidation refers to process during which web cache proxies declare cached content as invalid, meaning it will not longer be served as...
Read more >
Cache invalidation overview | Cloud CDN
After an object is cached, it normally remains in the cache until it expires or is evicted to make room for new content....
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