As of version 3.x Symfny supports Redis as a cache.
It is working fine, but only if I want to get some data from cache like:
$redis = $this->get('cache.app');
$cached = $redis->getItem('video#32');
$data = $cached->get();
if (!$cached->isHit()) {
$cached->set([
'users' => [
$userId => [
'username' => $userName,
'refresh' => new \DateTime()
]
]
])->tag('stack, overflow, symfony, support');
$redis->save($cached);
}
Is it possible to search/find all rows from cache with tag stack
and support
? I was searching for it in the symfony docs but there is no information about it. If it is not possible, when and how I should use tags if I cannot use them for searching?
btw: there is information that we need to use TaggedCacheItemInterface
but several days later it was dropped here