Search code examples
htmlangularjsbrowser-cache

Force browser to load last angularjs app code


I have a web application in production environment because of cache clients does not always have the newest version of our code

How can I solve this problem please ?


Solution

  • Just add a version param to the url of your scripts:

    <script type="text/javascript" src="my-script.js?v=1.0.1"></script>
    

    This way, you can control manually wich one of your script needs to be reloaded. You shouldn't have to change anything to your file name.