This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
How to Resolve Browser Cache Invalidation Issue in Vite-React Project Deployment? #17540
Closed
7 tasks done
Labels
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
The text was updated successfully, but these errors were encountered: