Use Redis for caching doctrine result in Symfony 2 application Use Redis for caching doctrine result in Symfony 2 application symfony symfony

Use Redis for caching doctrine result in Symfony 2 application


The configuration you've added for result cache only configures the strategy to use. You still need to explicitly tell doctrine to cache results for specific queries:

$query->useResultCache(true);

Learn more about it in the Doctrine's Cache docs.

Documentation in Symfony is sparse, as this is not really a Symfony specific thing. Read the doctrine documentation instead. Only use Symfony docs to learn how to configure Doctrine.

You don't need any Redis bundles, as Redis caching strategy is implemented by doctrine with the doctrine/cache package. You don't have to worry how to use it. Simply configure the cache as described in the docs.