I recently wrote my first Symfony2 application, and everything is fine, but now I want to add query caching to improve performance and reduce unnecessary queries. I added the following lines to one specific query builder:
$query->useResultCache(true) ->useQueryCache(true);
After the first request, the cache is used as expected. I can check this in the profiler. All perfectly!
The problem is that I also have a simple admin panel that I wrote that allows the user to change the contents, but after the changes the cached version is still in use.
Is there a way to programmatically tell Symfony2 / Doctrine to clear the query cache when updating data, or is there a way to configure it?
It seems like this will be a common problem, but I can not find anything on Google on this problem!
source share