How to Prevent Caching
src file in an HTML file, developers often append a question mark followed by some kind of timestamp or hash. This doesn't affect the resolution of the URL, but does ensure that a new file is cached when it is downloaded.
<body> <!-- The below import will always use cached if possible, regardless of changes to `file1.js` --> <script src="file1.js"></script> <!-- The below import will cache `file2.js` as the below filename, ensuring that new changes will be loaded and old versions will not load, even if old versions of `file2.js` exist --> <script src="file2.js?20201031"></script> </body>
Last modified: 202209241844