When I upload a new version of CSS files for my website, there is an issue where the clients viewing the pages might have a cached version on their computers. They can’t see the CSS updates (or even some other static assets like images) until they clear their cache, or press Ctrl + F5. This is obviously not an ideal solution.
One way to deal with this would be to rename the CSS files every time I uploaded a new build of the website. Is there any way to do this automatically via Visual Studio? I am using AnkhSVN for version control, so if I could get a script to do this automatically for the selected files, that would work too.
I didn’t even know what exactly to Google for – could somebody point me in the right direction, and suggest best practices?
Edit: Oh, and forgot to mention – I would need to do this in combination with the expires tag on static assets. Since I’m still early into my research, I’m not sure how this ties in.
Thanks!
One simple fix is to add a query string to the url of your css file. So instead of refering to file.css you refer to file.css?a=1. The next time you change the css file you just change the query and the file will be redownloaded.