inertiajs / inertia-laravel

The Laravel adapter for Inertia.js.
https://inertiajs.com
MIT License
2.03k stars 227 forks source link

How to handle load balancing and asset versioning #525

Closed HarryLee186 closed 1 year ago

HarryLee186 commented 1 year ago

Hi,

Assuming a scenario where a Laravel application is load balanced across multiple server, and assets are built for production using Vite on each server, how would one handle the asset versioning for Inertia? Each build/manifest.json returns a separate md5 string, so every request ends up resulting in a 409.

Open to ideas, I'm aware one could build assets in one location and copy them over to each server, set an asset_url and serve the assets from a subdomain, override the default version() functionality etc, but I'm curious as to whether there is a fairly standard solution to this.

marcuschristiansen commented 1 year ago

We ran into the same problem. We enabled sticky sessions on the load balancer which seems to have resolved the issue.

jessarcher commented 1 year ago

Hi there,

Thanks for reporting the problem you are encountering, but it looks like this is a question that may be better suited for a support channel. We only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use the functionality provided by this repository, you can try one of the following channels:

However, this issue will not be locked, and everyone is free to discuss solutions to your problem!