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.

Precached page '/' not updating after new build is deployed

See original GitHub issue

Recently this problem appeared in our pwa. I had all default settings in workbox pwa module and everything worked fine, but now it seems root page (/) is precached, it is exists in CacheStorage workbox-precache-v2-... After unregistering manually service worker this problem is gone, but only for the time before next page reload. I can solve issue by manually deleting this CacheStorage, but it’s not the solution because our users won’t do it manually.

Question is, by which way sw can force delete this cache for all users ? Or is there a way to disable precache of this page? Maybe there is another way to solve this?

Also we have cloudflare cache, could it be a problem?

Also have this warning: Workbox is precaching URLs without revision info: / but updated pwa-module to the latest version.

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
kedrzucommented, Oct 21, 2020

I also encountered this problem. I’ve read through source code and I don’t think it’s possible to fix it by ourselves - array of precached resources is built from webmanifest config and some defaults, which include / route.

Google docs say, that cache-first policy is used for precached resources, that’s why page is not refreshed. Precached resources are updated once service worker is, only if revision changes. And because no revision is used, it’s not updating.

Maybe some randomized revision would help?

Problem is, that we may get some non-deterministic behavior - service worker is not updated immadietely, when you open the page. It may take some time, especially if you have other tabs open, that it controls. So you would get the old version until the service worker is running.

It would be nice to be able to fine-tune precaching, so we’d be able to remove / from precached resources.

2reactions
pi0commented, Nov 28, 2020

Hi. This issue should be gone with 3.3.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

sw-precache not updating and taking only cached data
Two things to check: Ensure that you're not caching your sw.js file, as this could delay updates for up to 24 hours in...
Read more >
Workbox 4: Implementing refresh-to-update-version flow using ...
Build /deploy/serve/refresh the page: you still see Angular PWA 5. Hit browser's refresh button once again — now you see the new title....
Read more >
Cached version of website not updating on new build/repo ...
Hi! I recently switched my Github deployment over to a different repo, however, after deploying the new website it seems to still show...
Read more >
Handling service worker updates with immediacy
When a waiting service worker is found, this code informs the user that an updated version of the site is available and prompts...
Read more >
Automatic reload | Guide - Vite PWA - Netlify
With this behavior, once the browser detects a new version of your ... in the service worker precache manifest, but their revision will...
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