F
Filament13mo ago
Jocke

Laravel Vapor gzip

Hi. I'm trying to enable gzip responses in Laravel Vapor. I created a middleware similar to this one: https://bannister.me/blog/gzip-compression-on-laravel-vapor. I have added it to the web middleware group. It works perfectly on all ajax requests! But the first request is never gzipped? I tried adding my middleware under middleware in my filament panel provider. But then Filament stops working completely. I get a response with all the HTML but no navigation or ajax works. Does anyone know how to solve this?
3 Replies
Kristijan
Kristijan7mo ago
I have the same problem. Still not resolved.
ralphjsmit
ralphjsmit3w ago
Thank you so much for the solution, I also just needed this. Have you got any clue why this is the solution? Ok, it was actually not too hard to figure out 😄 Livewire injecting features comes after all the middleware because it listens to the RequestHandled event. If the response then already is gzipped or brotli'd, then it will not inject the assets and you get this empty page type of thing.

Did you find this page helpful?