Search code examples
cssasp.netiis-7stylesheet

CSS is not working after deployment in IIS


I have done some css changes in one already hosted website in IIS. but customers are not able to see updated changes unless i personally ask them to press ctrl + F5. Is there any way through which i can handle this issue.


Solution

  • You need to version your CSS. At its simplest you would simply add ?v=1.0 at the end of the URL that includes the stylesheet.

    Moving on from that you can automate that process, for example by reading the file modification date of the CSS file and appending that.

    This is a very powerful method to ensure no one ever sees "old" css again, whilst levering the cache to its fullest ability.