How to force browser not to cache JavaScript?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/code-flow.club/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
8 views
Is there any effective way to force the browser not to cache a specific Javascript file? It is desirable that this method worked in Firefox, Opera and Chrome (IE not particularly interested).
by | 8 views

5 Answers

0 like 0 dislike
change the file name.
for example, you so script.js?123
instead of a number, i.e. I put the hash sum of the file
by
0 like 0 dislike
And maybe easier on the server side to include the script directly in the html? Each time you refresh the page, the script will restart. Usually this extra traffic, but in your case it will not be superfluous because you want to update the script constantly.
by
0 like 0 dislike
Set the correct headers with the web server.
by
0 like 0 dislike
In all browsers refresh the page with Ctrl+R. never had any problems with the cache.
by
0 like 0 dislike
In ff disabled all caching, atsunobu netwotk.http.use-cache to false.
Tough but worked.
by
110,608 questions
257,186 answers
0 comments
22,132 users