Does anyone know how to make the client go to the server to download the latest CSS and js after a website or web application is updated to a new version, instead of reading it from the cache?
After searching on my own, most suggestions are to add a version number in the middle or at the end of the CSS and JS file names, such as main.123456.min.css or main.min.css? version=123456.
If anyone has practical experience in this area, please enlighten me! Many thanks!
Use packaging tools such as webpack to automatically version assets for static resources.
For example main.123456.min.css or main.min.css? version=123456
There is nothing wrong with this, I do it too. Caching is an optimization