Hi Team,
I've a question regarding memcache.
I'm following the instructions here, and I do know that I have memcached working correctly as I use it also for my own queries. I want to also use it for queries that I pass on to datatables. So basically, I have this:
$this->ds = new \koolreport\datasources\PdoDataSource(...);
later...
$this->ds->query($query)->params($params)
which I pass on to
DataTables::create(array(
...
"dataSource" => function () {
return $this->ds->query($query)->params($params);
},
Now it works all well, but it does not use the cache.
I'd actually even rather like to just pass on a result set to my datatables content, but my understanding is that I'd then have to also implement serverside myself. Like I've a number of graphs that I display too, and their data is fetched from the database and then cached. That works fine.
When I experiment with the cache in the report, so here...
use \koolreport\cache\MemCache;
class MyReport extends KoolReport
{
function cacheSettings()
{
return array(
"ttl"=>60,
"servers"=>array(
"localhost"=>11211,
)
);
}
and e.g. I don't put the right port, nothing apparently happens. So it's not even trying to use it.
Any idea how to use a datatable with the cache?
Thanks!