Response time and size
Hello,
during playing around with laravel-filament I realized that response is quite huge. For example I have CustomerResource table, which has no relations and it is pretty straightforward:
->columns([
Tables\Columns\TextColumn::make('firstName')->searchable(),
Tables\Columns\TextColumn::make('lastName')->searchable(),
Tables\Columns\TextColumn::make('mobileNumber')->searchable(),
Tables\Columns\TextColumn::make('email')->searchable(),
// TextInputColumn::make('mobileNumber'),
])
Yet, when I choose 50 records, response from serves has over 700kB and takes over 1s.
I guess it is normal, since livewire is generating whole html on server side, but is there any way how to tweak it a little? I have bulkactions usecase where i need to render hundreds of records on one page and change status of it and response has over 70MBs and browser renders it in about 40s.
Thanks for any tips!
Cheers.Solution:Jump to solution
Compression is on
nginx
configuration on the server
you have to google it π
depend on your system...6 Replies
I guess you're in dev environment
so cache everything and compare the results
in prod you advised to cache everything
also add indexing to db if needed
Thx for answer, @Lara Zeus . Unfortunately, it did not help, it's the same. I added indexes as well, still the same. When I look at livewire/update response for 50 records, it has "html" object containing 700k characters.
I tried to do the same with filament demo, and it works better, as the response is compressed, see image. My app is not compressing response, is there a way how to enable compression at least?
Solution
Compression is on
nginx
configuration on the server
you have to google it π
depend on your systemI needed to install erlandmuchasaj/laravel-gzip as I run it with artisan serve. Ok, so now I am compressing it, which is much better but ... I need to turn off displaying "all" records π¦
It's just how livewire works. Only way to compress using server
Yeah, got it now. Thanks!