I've recently written my first Symfony2 app and all is well, except now I want to add in some query caching to improve performance and cut down on unneeded queries. I've added the following lines to one particular query's builder:
$query->useResultCache(true)
->useQueryCache(true);
After the first request, the cache is then used as expected. I can verify that in the profiler. All is great!
The problem is I also have a simple admin panel I wrote that allows the user to modify the content, but after changes the cached version is still being used.
Is there a way I can 'programmatically' tell Symfony2 / Doctrine to clear the query cache as I update the data, or is there a way of configuring this?
It seems like it would be a common issue but I can't find anything on Google relating to the issue!