javascriptcssbrowserbrowser-cache

How to remove/replace cached css and js file from client Browser?


Is there a way by which we can replace or remove the cached css and js files from client browser when they come to the website next time?


Solution

  • Yes, give it a version number of sorts. For example, client is on your site and loads:

    http://path/to/cssFile.css
    

    If you change this and add a version number, when they visit again they will download it again, e.g.

    http://path/to/cssFile.css?version=1.001