Question: I’m currently running a laravel with VueJs Web application. I made some changes to the css and released the new version a few days ago. Most of the css messed up because of browser cache.
Instead of asking users to force reload cache, which is not feasible , is there another way to force browser to retrieve the new version of files so that the changes are reflected?
Thank you!
Answer: Yes, you can prevent the browser caching of your newly updated script by adding a version number at the end of the file. Use Following method to update version.
<link
rel="stylesheet"
href="{{ asset('css/app.css?v='.filemtime(public_path('css/app.css'))) }}"
/>