14
Every time I publish a new version of my web application (a multienterprise system) that has changes in JS and CSS files, some clients complain of errors and I end up finding that is the cache of the browser and I have to instruct the client to update the page with CtrlF5.
I wonder if there’s a way I can force the browser to fetch the JS and CSS files on the server every time I publish a new version (maybe saving a cookie on the client informing the system version the last time it was accessed and compare each load).
I searched Google and couldn’t find any information that really helped me. My application is in C#. Net.
Related: What is it for and when to use version in . js or . css files?
– Renan Gomes
maybe you can find something you can use here: https://css-tricks.com/strategies-for-cache-busting-css/
– Caio Felipe Pereira
I don’t know how to do this on IIS, but somewhere in your app.config you can instruct browsers not to cache these files.
– bfavaretto
If it is to generate a dynamic link I think concatenating the timestamp as a parameter in the url also works, as in ajax requests.
– DontVoteMeDown