Hey @pascalbaljet, hope you're doing fine!
I wanted to share something that has been troubling me for a few months with Inertia. Managed to troubleshoot but still not sure what's the original "cause".
The main issue is caused by this line in app.blade.php:…
Commit
54be02f
Hey! The cause is the
I've never run into this in production myself to be honest, but the buffer/middleware fix seems to be the consensus.
AddLinkHeadersForPreloadedAssets middleware in bootstrap/app.php, not the @vite directive itself. It adds every chunk the page imports to a single Link response header, which can exceed nginx's default buffer size on larger pages. You can increase the buffer (see https://github.com/inertiajs/inertia-laravel/issues/529) or limit the number of preloaded assets in the middleware:
php
AddLinkHeadersForPreloadedAssets::using(limit: 10)
GitHubnginx header limitation · Issue #529 · inertiajs/inertia-laravelOpening this issue to aid others running into a somewhat bizarre issue, might also be cause for some documentation. When applying the @inertia directive the yielded result contains both the page te...
commit 54be02f
Thanks for your answer! Yeah, I believe I had tracked AddLinkHeadersForPreloadedAssets as being the cause when I investigated few months back. I think it might be the default buffer settings that are too low on Ploi, because I have reached this issue consistently on almost all…