Answer the question
In order to leave comments, you need to log in
How to force the browser not to cache JavaScript?
Is there any efficient way to force the browser not to cache a particular Javascript file? It is desirable that this method works in Firefox, Opera and Chrome (IE is not particularly interested).
Answer the question
In order to leave comments, you need to log in
change the file name.
for example, you can script.js?123
instead of a number, for example, I substitute the hash sum of the file
Or maybe it's easier, on the server side, to include the script directly in html? The script will be reloaded every time the page is refreshed. Usually this is extra traffic, but in your case it will not be superfluous. you need to update the script constantly.
In all browsers I refresh the page with Ctrl+R. Never had a problem with the cache.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question