|
18 | 18 | useSymfony\Component\Cache\Traits\RedisTrait; |
19 | 19 |
|
20 | 20 | /** |
21 | | - * Stores tag id <> cache id relationship as a Redis Set, lookup on invalidation usingsPOP. |
| 21 | + * Stores tag id <> cache id relationship as a Redis Set, lookup on invalidation usingRENAME+SMEMBERS. |
22 | 22 | * |
23 | 23 | * Set (tag relation info) is stored without expiry (non-volatile), while cache always gets an expiry (volatile) even |
24 | 24 | * if not set by caller. Thus if you configure redis with the right eviction policy you can be safe this tag <> cache |
25 | 25 | * relationship survives eviction (cache cleanup when Redis runs out of memory). |
26 | 26 | * |
27 | 27 | * Requirements: |
28 | 28 | * - Client: PHP Redis or Predis |
29 | | - * Due to lack of RENAME support it isnot recommended to usePredisCluster, instead useRedisCluster. |
| 29 | + *Note:Due to lack of RENAME support it isNOT recommended to useCluster on Predis, instead usephpredis. |
30 | 30 | * - Server: Redis 2.8+ |
31 | 31 | * Configured with any `volatile-*` eviction policy, OR `noeviction` if it will NEVER fill up memory |
32 | 32 | * |
33 | 33 | * Design limitations: |
34 | 34 | * - Max 4 billion cache keys per cache tag as limited by Redis Set datatype. |
35 | | - * E.g. If you use a "all" items tag for expiry instead of clear(), that limits you to 4 billion cache itemsas well. |
| 35 | + * E.g. If you use a "all" items tag for expiry instead of clear(), that limits you to 4 billion cache itemsalso. |
36 | 36 | * |
37 | 37 | * @see https://redis.io/topics/lru-cache#eviction-policies Documentation for Redis eviction policies. |
38 | 38 | * @see https://redis.io/topics/data-types#sets Documentation for Redis Set datatype. |
@@ -144,10 +144,7 @@ protected function doDelete(array $ids, array $tagData = []): bool |
144 | 144 | protectedfunctiondoInvalidate(array$tagIds):bool |
145 | 145 | { |
146 | 146 | if ($this->redisinstanceof \Predis\ClientInterface &&$this->redis->getConnection()instanceof ClusterInterface) { |
147 | | - CacheItem::log( |
148 | | -$this->logger, |
149 | | -'Cluster on Predis does not support RENAME so there is a risk of race conditions on tag invalidation, please use phpredis instead.' |
150 | | - ); |
| 147 | + CacheItem::log($this->logger,'Cluster on Predis does not support RENAME so there is a risk of race conditions on tag invalidation, use phpredis instead.'); |
151 | 148 | $movedTagSetIds =$tagIds; |
152 | 149 | }else { |
153 | 150 | $movedTagSetIds =$this->renameKeys($tagIds); |
@@ -179,13 +176,13 @@ protected function doInvalidate(array $tagIds): bool |
179 | 176 | /** |
180 | 177 | * Rename several keys in order to be able to operate on them without risk of race conditions. |
181 | 178 | * |
182 | | - * Filters out keys that does notexists before returning new keys. |
| 179 | + * Filters out keys that does notexist before returning new keys. |
183 | 180 | * |
184 | 181 | * @see https://redis.io/commands/rename |
185 | 182 | * |
186 | | - * @param array $idsthe Orginal cacheid's |
| 183 | + * @param array $idsThe original cacheids |
187 | 184 | * |
188 | | - * @return arrayfiltered list of the valid moved keys (only those that existed) |
| 185 | + * @return arrayFiltered list of the valid moved keys (only those that existed) |
189 | 186 | */ |
190 | 187 | privatefunctionrenameKeys(array$ids):array |
191 | 188 | { |
|