How to Resolve Browser Cache Invalidation Issue in Vite-React Project Deployment? #17556
Unanswered
ameeetgaikwad
asked this question in
Q&A
Replies: 2 comments 1 reply
-
Has there been any progress with this issue? I also run into this constantly. Edit: I found some potential workarounds here that didn't end up working for me: https://stackoverflow.com/questions/68046410/how-to-force-vite-clearing-cache-in-vue3 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Same issue for me too in my production app with react-vite with npm and i went through the link provided by @forrestwilkins and it didn't work for me. When doing hard refresh my app loads and if i refresh again the app tries to fetch old version of js files |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
Encountering a persistent issue with my Vite-React project deployment. Whenever I deploy a new version, the changes are not reflected on the production URL. Instead, they only appear after performing a hard reload. This seems to be a cache-related problem.
Details: I have a Vite-React project deployed in a production environment. However, whenever I push updates and redeploy the application, users visiting the site often don't see the latest changes until they perform a hard reload (Ctrl + Shift + R or Cmd + Shift + R). This indicates that there's a caching issue preventing the new version from being fetched and displayed immediately.
Also when the hard reload is done, and after that i again visit the website I again see the old website, the new changes disappears again.
Config:
app.tsx
registerServiceWorker.js
sw.js
vercel.json
vite.config.ts
Reproduction
Steps to reproduce
When u visit the website for the first time and when and update is made to the website you will face the issue from next time you visit the website.
System Info
Used Package Manager
bun
Logs
No response
Validations
Beta Was this translation helpful? Give feedback.
All reactions