We are using laravel mix (laravel 9) with vuetify 2 (vue 2) in a production environment hosted in ECS.
Our builds etc and deploy just fine, but our user base need to either refresh their browser, or on some occasions clear their caches for their browser to display the latest build.
We have followed the laravel-mix documentation and using mix.version() appropriately. Our public/js files are being hashed as expected and a refresh shows the updated ID being pulled.
But my understanding was the browser should automatically see a change a pull it without a refresh being required.
I assume we are doing something wrong.
mix.js('resources/js/main.js', 'public/js/app.js')
.webpackConfig(require('./webpack.config'))
.vue()
.vuetify('vuetify-loader', 'resources/js/assets/scss/theme.scss')
.sass('resources/js/assets/scss/theme.scss', 'public/css/app.css')
.version();
mix.copyDirectory('resources/js/assets/images', 'public/images');
if (mix.inProduction()) {
mix.version();
}
Please note, i added version() into the upper block for testing purposes, generally we use the if statement below to ensure this only happens in production builds.
Our mix manifest is updating as expected too.
What may we be missing here?