Open
Description
Summary of problem or feature request
If one adds some sort of eloquent model caching mechanism, such as laravel-model-caching
data queries are nicely cached and retrieved from cache upon subsequent requests, however count queries (for getting total and filtered count) are not. And every page change triggers those. Since I work with a large dataset, that has some joined tables, both count queries take about 350ms each (data query for page takes about 100ms). Which is why I would want to cache them.
Count does not change that often.
I suspect this happens because counting is done with raw query, instead of using eloquent and count()
.
laravel-datatables/src/QueryDataTable.php
Line 190 in d1bc415
System details
- Operating System Linux
- PHP Version PHP 7.3.6-1+ubuntu18.04.1
- Laravel Version 5.8
- Laravel-Datatables Version 9.0