I've implemented Redis caching on a Symfony2 project. Now I want to cache the results of find() and findBy() methods for some entities and keep them for specific TTL in Redis(like one week or until the next flush).
My questions are:
for findBy():
for findBy(array $criteria ...)
I have an event listener for the onFlush() event, which invalidates the cache for specific entities.
Do you think is a good aproach? Is there something I should watch out for? Thank you