I have a react application deployed to AWS Amplify. However, every time I push a new feature to the pipeline, the feature will not appear on the live site right away. I understand that the build takes time but the problem persists even after Amplify notifies me that the build was completed. I believe it has to do with the browser cache, because opening up the site in an incognito tab works.
Therefore, does anyone know how to address the issue? I could not ask clients to clear their cache every time I made an update…
2
Answers
You can add
Cache-Control
tag on yourpublic/index.html
Example.
you can also disable your broswer caches by inspect then go to your network tab and disable your caches then run
npm run dev
with flag--force
to rebuild dependencies again and refresh your broswermore info can be found here in vite doc website https://vitejs.dev/guide/dep-pre-bundling.html#browser-cache