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!
Yes, you can prevent the browser caching of your newly updated script by adding a version number at the end of the file.
<link
rel="stylesheet"
href="{{ asset('css/app.css?v='.filemtime(public_path('css/app.css'))) }}"
/>
The same you can do with the js file as well.
the filemtime()
method returns the file modification time, that only changes when you modify your css file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With