I'm trying to use the doctrine cache in order to save the data results from queries.
I've updated the doctrine info in the config file with the following cache config options:
orm:
...
metadata_cache_driver: apc
query_cache_driver: apc
result_cache_driver: apc
Here is a query example where I apply the results cache:
$query = $this->repository->createQueryBuilder('fp')
->where('fp.userId = :userId')
->setParameter('userId', $userId)
->getQuery()
->useResultCache(true, 3600, 'favorite');
return $query->getResult();
It retrieves the data without error but it seems that it doesn't store the result in the APC cache.
I try the following code in order to check if the query result has been cached in APC:
$q = new \Doctrine\Common\Cache\ApcCache();
$data = $q->fetch('favorite');
However data always returns the false boolean.
I've checked that APC is enabled in the php.ini files and also it appears enabled in the Symfony profiler.
Anything I might be missing?