If you cannot avoid the CACHE you can do with PHP (I imagine it is what you use in your hosting) to generate a number that never repeats, I advise using DATE and TIME so that the browser interprets as different Urls through a variable.
The format will not be noticed as date and time, I put in the example only up to minutes and not seconds to not generate an unnecessary load of access to your hosting.
Harvest this at the beginning of the code.
<?php
$nc = "?".date('YmdHi'); //Exemplo do resultado 201802061040
?>
Examples:
<script src="seuscript.js<?php echo $nc ?>"></script>
<img src="imagem.jpg<?php echo $nc ?>" />
This will only affect content placed in HTML, if the visitor accesses urls of/db text files (*.TXT, *.LOG, *.JSON) or images directly typed in the browser bar will only see the first version of the file until the CACHE expires.
In this case I advise you to modify the HTACESS of your hosting, it will make any code dispensable:
<filesMatch "\.(html|htm|js|css|png|gif|jpg|jpeg|json)$">
FileETag None
<ifModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</ifModule>
</filesMatch>
What is called this kind of problem? these metatags have solved my problem, thank you
– Nicolas Guilherme Matheus
@Nicolasguilhermematheus is just Cache. Not necessarily a problem!
– LTafarelo