Reputation: 538
I have a table that contains more than 15k rows of records.
I'm pulling out the data and displaying it in a jquery datatable plugin but it took like few minutes to display. Any suggestions how to reduce the page load time?
This is how I extract data in the Controller.
$model = Property::model->with('estates','types','tenures','rooms','districts')->findAll();
$this->render('index', compact('models','pages'));
Upvotes: 1
Views: 1635
Reputation: 1659
Use pagination and just omit "with", that way the records will be eagerly loaded, so only those needed to display would actually be in cache. Give it a try and you'll see immediate difference.
Upvotes: 1