How to prevent caching of my Javascript file?
Add a random query string to the src
You could either do this manually by incrementing the querystring each time you make a change:
<script src="test.js?version=1"></script>
Or if you are using a server side language, you could automatically generate this:
ASP.NET:
<script src="test.js?rndstr=<%= getRandomStr() %>"></script>
More info on cache-busting can be found here:
https://www.curtiscode.dev/post/front-end-dev/what-is-cache-busting
BufferedDynamicImageResource cached by browser
The most common way to solve this would be to mount the resource as seen here. Using this approach, you could use the id as a parameter or add an (ignored) random parameter to prevent caching completely.
Cache-Control through Front-End?
So in the end, this is almost always better solved on the server-side. @RenanIvo did comment a good link on the depreciated HTML meta cache control, and im my experience the server is always the answer (or at least the best one).
Related Topics
Floated Elements of Variable Height Push Siblings Down
How to Match Width of Text to Width of Dynamically Sized Image/Title
Css Negation Pseudo-Class :Not() For Parent/Ancestor Elements
Make Body Have 100% of the Browser Height
Flex Property Not Working in Ie
What's the Difference Between an Id and a Class
Css3 100Vh Not Constant in Mobile Browser
How to Reorder My Divs Using Only Css
Limit File Format When Using ≪Input Type="File"≫
Using Relative Url in CSS File, What Location Is It Relative To
Fluid Width With Equally Spaced Divs
Applying a Background to ≪Html≫ And/Or ≪Body≫
Testing Text() Nodes VS String Values in Xpath
How to Put Two Button in the Same Line Using Only HTML and CSS
Changing the Symbols Shown in a HTML Password Field
How to Stop Background from Jumping to the Top on Modal Toggle