Deploying
Build your assets (
npm run build). The Vite plugin writes the client manifest first (inertia-static:manifest); run that command yourself if you build without the plugin. The Inertia asset version changes, so every page JSON gets a new URL (/__inertia/{newVersion}/...) automatically.Purge the HTML (it embeds the asset URLs and the version), then warm it:
bashphp artisan inertia-static:purge --all --warmIn headers-only mode there is nothing to purge: the HTML refreshes after
revalidate.Keep the previous build's assets for a few hours. Visitors with an old page open keep loading old chunks until their next full reload.
Mid-session version change
A visitor with an old page open requests /__inertia/{oldVersion}/page.json:
- if the CDN still has it, it is served: old page, old assets, still consistent;
- otherwise the origin answers
409+X-Inertia-Locationand Inertia performs one full reload onto the new version. Then navigation continues on the new version.
Laravel Octane
The package works with Octane (FrankenPHP, Swoole, RoadRunner) with no extra setup: its request state is reset on every request, and Octane's default listeners are enough. After a deploy, reload the workers so they load the new build and routes:
php artisan octane:reloadA route the leak detector turns dynamic (auto mode) is dynamic from the next request in the worker that saw the leak; other workers switch the first time they render it. After php artisan inertia-static:routes --reset-downgrades, run php artisan octane:reload.
Checklist
- [ ]
INERTIA_STATIC_BASE_URL(orAPP_URL) is the public URL. - [ ]
INERTIA_STATIC_CDNand the driver's credentials are set (without credentials: headers-only mode). - [ ] If you use Inertia SSR: the SSR server runs in production (
php artisan inertia:start-ssrunder a supervisor). - [ ] A queue worker runs (purges are queued).
- [ ] With Octane:
php artisan octane:reloadruns after each deploy. - [ ] The CDN caches HTML and JSON (see your CDN page).
- [ ]
public_shared_propsonly lists public data. - [ ]
php artisan inertia-static:doctorpasses.