Search code examples
c#asp.netcssmaster-pages

Force browser to use new CSS


Is there a way to check if the user has a different version of the CSS cached by their browser and if so force their browser to pull the new version?


Solution

  • I don´t know if it is correct usage, but I think you can force a reload of the css file using a query string:

    <link href="mystyle.css?SOME_UNIQUE_TEXT" type="text/css" rel="stylesheet" />
    

    I remember I used this method years ago to force a reload of a web-cam image, but time has probably moved on...