Answer the question
In order to leave comments, you need to log in
How to update the js file on the client if it has changed on the server?
When developing a web application, after the next change in js files, cached versions remain on the clients, which causes errors. Not all users know when and how to clear the cache. How to make sure that when updating js files on the server, clients download updated files and do not use outdated versions in the local cache.
Answer the question
In order to leave comments, you need to log in
<script src="js/file.js?<?=filemtime( 'js/file.js' )?>" />
I found a good solution to embed the md5 hash of the file in the URL of the link, when the file changes, the hash will change and the file will be downloaded by the client. stackoverflow.com/questions/118884/what-is-an-eleg...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question