I am currently creating and deploying a build-responsive site using "build response scripts" and then copy the contents of the build directory to the apache web directory. The web directory contains the index.html file, which points to the compiled React js file through the script tag as follows:
<script type="text/javascript" src="/static/js/main.dd92ea42.js"></script>
This is all the built-in behavior of "response-script build". I found that even when I create a new index.html file and change the content (the path to the .js file changes with every deployment), the browser still caches the entire application. Even with a "hard" site update, new content does not load. I have to completely remove the cache and then reload something in order to update.
Is there any trick for caching using the create-react-app and building through response scripts? I assume that the browser only looks at the index.html file if it does not have a cached application and does not look at it anymore? Otherwise, I do not understand why it does not see changes in the index.html file when redeploying.
So, what's the trick for deploying app-app-app-app-application, so that each deployment invalidates the browser cache, and users donβt need to go through hoops to get the new version?
source share