This is a common problem with SPA. If a JS file has been updated, display a message to reload the page.
Do not use the clear command.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hey,
I am using Laravel 8 + InertiaJs + ReactJs + MySQL with Mix. the thing is that in production the ui does not update on deploy or just appear broken for some time.
I have to delete cache or press f5 which is not good for users. I tried npm prod and production before deploy. As well as:
php artisan cache:clear php artisan route:clear php artisan config:clear php artisan view:clear php artisan optimize:clear
In local and production console in digitalocean.
I added mix.version() in webpack.mix:
const mix = require('laravel-mix');
mix.js('resources/js/app.js', 'public/js') .react() .postCss('resources/css/app.css', 'public/css') .version();
In local with npm run watch works fine, the issue is only on production.
Any other way to handle the js/css update on deploy?
Did you configure inertia for asset versioning? https://inertiajs.com/asset-versioning
Please or to participate in this conversation.