You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 4.4:
[ErrorHandler] fix handling buffered SilencedErrorContext
[HttpClient] fix Psr18Client when allow_url_fopen=0
[DependencyInjection] Add support of PHP enumerations
[Cache] handle prefixed redis connections when clearing pools
[Cache] fix eventual consistency when using RedisTagAwareAdapter with a cluster
[Validator][Translation] Add ExpressionLanguageSyntax en and fr
[HttpKernel] [HttpCache] Keep s-maxage=0 from ESI sub-responses
[Cache] Disable locking on Windows by default
[DependencyInjection] Fix binding "iterable $foo" when using the PHP-DSL
[Config] fix tracking default values that reference the parent class
[DependencyInjection] fix accepted types on FactoryTrait::factory()
[VarDumper] Fix tests for PHP 8.1
[Mailer] fix encoding of addresses using SmtpTransport
[MonologBridge] Fix the server:log help --filter sample
Copy file name to clipboardExpand all lines: Adapter/RedisTagAwareAdapter.php
+70-78Lines changed: 70 additions & 78 deletions
Original file line number
Diff line number
Diff line change
@@ -23,17 +23,13 @@
23
23
useSymfony\Component\Cache\Traits\RedisTrait;
24
24
25
25
/**
26
-
* Stores tag id <> cache id relationship as a Redis Set, lookup on invalidation using RENAME+SMEMBERS.
26
+
* Stores tag id <> cache id relationship as a Redis Set.
27
27
*
28
28
* Set (tag relation info) is stored without expiry (non-volatile), while cache always gets an expiry (volatile) even
29
29
* if not set by caller. Thus if you configure redis with the right eviction policy you can be safe this tag <> cache
30
30
* relationship survives eviction (cache cleanup when Redis runs out of memory).
31
31
*
32
-
* Requirements:
33
-
* - Client: PHP Redis or Predis
34
-
* Note: Due to lack of RENAME support it is NOT recommended to use Cluster on Predis, instead use phpredis.
35
-
* - Server: Redis 2.8+
36
-
* Configured with any `volatile-*` eviction policy, OR `noeviction` if it will NEVER fill up memory
32
+
* Redis server 2.8+ with any `volatile-*` eviction policy, OR `noeviction` if you're sure memory will NEVER fill up
37
33
*
38
34
* Design limitations:
39
35
* - Max 4 billion cache keys per cache tag as limited by Redis Set datatype.
@@ -49,11 +45,6 @@ class RedisTagAwareAdapter extends AbstractTagAwareAdapter
49
45
{
50
46
use RedisTrait;
51
47
52
-
/**
53
-
* Limits for how many keys are deleted in batch.
54
-
*/
55
-
privateconstBULK_DELETE_LIMIT = 10000;
56
-
57
48
/**
58
49
* On cache items without a lifetime set, we set it to 100 days. This is to make sure cache items are
59
50
* preferred to be evicted over tag Sets, if eviction policy is configured according to requirements.
@@ -96,7 +87,7 @@ protected function doSave(array $values, int $lifetime, array $addTagData = [],
96
87
{
97
88
$eviction = $this->getRedisEvictionPolicy();
98
89
if ('noeviction' !== $eviction && 0 !== strpos($eviction, 'volatile-')) {
99
-
thrownewLogicException(sprintf('Redis maxmemory-policy setting "%s" is *not* supported by RedisTagAwareAdapter, use "noeviction" or "volatile-*" eviction policies.', $eviction));
90
+
thrownewLogicException(sprintf('Redis maxmemory-policy setting "%s" is *not* supported by RedisTagAwareAdapter, use "noeviction" or "volatile-*" eviction policies.', $eviction));
100
91
}
101
92
102
93
// serialize values
@@ -163,15 +154,9 @@ protected function doDeleteYieldTags(array $ids): iterable
0 commit comments