Home > Mobile >  Slow loading when data more than 1000
Slow loading when data more than 1000

Time:09-29

The issue is that my laravel application speed's is too slow when the result has over 7k rows.

It keep loading for at 23 seconds or more to show the data in a table (i'm using bootstrap model of datatable)

System details: PHP Version 8.0.2 Laravel Version 9.11

enter image description here

CodePudding user response:

i used paginate in my controller in this way :

public function list(){
$file = File::orderBy('date', 'DESC')->paginate(10);
return view('welcome' , compact('file'));
}

and i add this line in Blade :

{{ $file->links() }}

and it works at 702ms but the search of datatable works only in the current page not on the whole table.

CodePudding user response:

Well, you can use Cache and Pagination to solve this problem.

  • Related