Old vuepress service worker cached
See original GitHub issueDescribe the bug
Hi👋
Amazing work with vitepress! Thanks for that!
I have a small issue with my docs site. I used to have a vuepress app running my old docs and switched to vitepress. Some users are still seeing the same old site (vuepress) when they navigate to a URL instead of the new one (vitepress).
My question is: How can I bust the client cache from the server?
The website is https://docs.avohq.io/ and it’s hosted on netlify.
Thank you,
Reproduction
I can’t offer a reproduction unless you’ve previously visited the old site.
Expected behavior
The new site (vitepress) should be visible, not the old one (vuepress).
System Info
System:
OS: macOS 12.6
CPU: (10) x64 Apple M1 Max
Memory: 40.16 MB / 64.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 14.20.0 - ~/.nvm/versions/node/v14.20.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v14.20.0/bin/yarn
npm: 6.14.17 - ~/.nvm/versions/node/v14.20.0/bin/npm
Browsers:
Chrome: 106.0.5249.119
Firefox: 104.0
Safari: 16.0
Safari Technology Preview: 16.0
npmPackages:
vitepress: ^1.0.0-alpha.19 => 1.0.0-alpha.19
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Guide | PWA Support - vuepress-theme-hope
Service Worker (SW for short) is mainly used to cache and proxy site content. This plugin will automatically register Service Worker through ...
Read more >Service Worker not busting cache. · Issue #177 - GitHub
Hello, I've got a weird issue. In devtools, I have cache disabled. When I hit ctrl+r, it still lads a cached old file...
Read more >Vue PWA not getting new content after refresh - Stack Overflow
What's happening here is that when the updated function gets called in the service worker it goes through and deletes all the caches....
Read more >Caching in a Vue.js PWA - Axel Hodler - Medium
App is being served from cache by a service worker. [...] Service worker has been registered. New content is downloading. New content is...
Read more >Service worker delivering old cached files - Vue Forum
Hello, I had a very basic (and buggy) service worker on production environment several months ago. The project was generated with vue-cli ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@adrianthedev Issues are for actual issues (bug reports) or feature requests. When you say “Some users are still seeing the same old site…” this is not a VitePress problem. VitePress has nothing to do with your old site. So it sounds very much like your hosting service settings issue.
For those questions would be better handled in Discord or in Discussions. You can join Vue.js Official Discord here (which has VitePress channel). https://discord.com/invite/HBherRA
Sorry for adding to a closed issue.
I was able to track down the Discord discussion related to this problem and I thought it would help others who face the same problem.
You have an existing VuePress site deployed on a host like netlify, gitlab pages, github, etc. You deploy your new VitePress site and the old site keeps displaying.
base: /yourbaseurl/
indocs/.vitepress/config.js
manifest.json
intodocs/public/manifest.json
docs/.vitepress/config.js
add aheader: []
section containingdocs/public/service-worker.js
with the following,The one downside I see is each time the service worker is run you get another Application entry. Maybe later you remove this code and assume all of your users have unregistered the old VuePress site?