Symfony + Redis - how to search by tag

Since version 3.x Symfny supports Redis as a cache .

It works fine, but only if I want to get some data from the cache, for example:

$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 lines from the cache with the stack

and tag support

? I have searched for it in the symfony docs but there is no information about it. If this is not possible, when and how should I use tags if I cannot use them for searches?

btw: there is information we should use TaggedCacheItemInterface

, but after a few days this was omitted here

+3
symfony symfony-3.1 symfony-3.2 redis


source to share


No one has answered this question yet

Check out similar questions:

1317
Memcached vs. Redis?
672
How do I remove everything in Redis?
545
How do I run Redis on Windows?
525
How to atomically delete keys matching a pattern using Redis
467
When is Redisu? When in MongoDB?
462
Redis command to get all available keys?
301
MISCONF Redis is configured to store RDB snapshots
3
Throw a group of keys by keyword in Redis
0
Can legacy data from Redis be used by design?
-1
Redis / Laravel - Keep getting errors: Unknown prefix:



All Articles
Loading...
X
Show
Funny
Dev
Pics