Commit 9fb8741
Apply Redis Cluster hash tags in RedisStore for all keys
This implements a comprehensive solution for Redis Cluster compatibility
by applying hash tags to all cache keys at the RedisStore level.
Implementation:
- Added applyHashTag() method to RedisStore
- Special handling for flexible() cache keys to ensure related keys
(value, created, lock) hash to the same slot
- Applied to all RedisStore methods: get, many, put, putMany, add,
increment, decrement, forever, lock, forget
Key format:
- Regular keys: {hash(key)}:key
- Flexible created keys: {hash(originalKey)}:illuminate:cache:flexible:created:originalKey
- Flexible lock keys: {hash(originalKey)}:illuminate:cache:flexible:lock:originalKey
This ensures that Cache::flexible() works correctly on Redis Cluster
including AWS ElastiCache Serverless (Valkey) while maintaining
backward compatibility with non-cluster Redis.
Reverted Repository.php and tests to original state as hash tags are
now handled transparently at the RedisStore level.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 0a669f4 commit 9fb8741
File tree
4 files changed
+98
-103
lines changed- src/Illuminate/Cache
- tests/Integration/Cache
4 files changed
+98
-103
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
62 | 87 | | |
63 | 88 | | |
64 | 89 | | |
| |||
69 | 94 | | |
70 | 95 | | |
71 | 96 | | |
72 | | - | |
| 97 | + | |
73 | 98 | | |
74 | 99 | | |
75 | 100 | | |
| |||
93 | 118 | | |
94 | 119 | | |
95 | 120 | | |
96 | | - | |
| 121 | + | |
97 | 122 | | |
98 | 123 | | |
99 | 124 | | |
| |||
116 | 141 | | |
117 | 142 | | |
118 | 143 | | |
119 | | - | |
| 144 | + | |
120 | 145 | | |
121 | 146 | | |
122 | 147 | | |
| |||
140 | 165 | | |
141 | 166 | | |
142 | 167 | | |
143 | | - | |
| 168 | + | |
144 | 169 | | |
145 | 170 | | |
146 | 171 | | |
| |||
173 | 198 | | |
174 | 199 | | |
175 | 200 | | |
176 | | - | |
| 201 | + | |
177 | 202 | | |
178 | 203 | | |
179 | 204 | | |
| |||
186 | 211 | | |
187 | 212 | | |
188 | 213 | | |
189 | | - | |
| 214 | + | |
190 | 215 | | |
191 | 216 | | |
192 | 217 | | |
| |||
198 | 223 | | |
199 | 224 | | |
200 | 225 | | |
201 | | - | |
| 226 | + | |
202 | 227 | | |
203 | 228 | | |
204 | 229 | | |
| |||
212 | 237 | | |
213 | 238 | | |
214 | 239 | | |
215 | | - | |
| 240 | + | |
216 | 241 | | |
217 | 242 | | |
218 | 243 | | |
| |||
225 | 250 | | |
226 | 251 | | |
227 | 252 | | |
228 | | - | |
| 253 | + | |
229 | 254 | | |
230 | 255 | | |
231 | 256 | | |
| |||
256 | 281 | | |
257 | 282 | | |
258 | 283 | | |
259 | | - | |
| 284 | + | |
260 | 285 | | |
261 | 286 | | |
262 | 287 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
488 | 488 | | |
489 | 489 | | |
490 | 490 | | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | 491 | | |
497 | | - | |
498 | | - | |
499 | | - | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
500 | 495 | | |
501 | 496 | | |
502 | 497 | | |
503 | | - | |
504 | | - | |
| 498 | + | |
| 499 | + | |
505 | 500 | | |
506 | 501 | | |
507 | 502 | | |
508 | 503 | | |
509 | 504 | | |
510 | 505 | | |
511 | 506 | | |
512 | | - | |
| 507 | + | |
513 | 508 | | |
514 | | - | |
| 509 | + | |
515 | 510 | | |
516 | 511 | | |
517 | | - | |
518 | | - | |
| 512 | + | |
| 513 | + | |
519 | 514 | | |
520 | 515 | | |
521 | 516 | | |
522 | 517 | | |
523 | | - | |
524 | | - | |
| 518 | + | |
| 519 | + | |
525 | 520 | | |
526 | 521 | | |
527 | 522 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | 489 | | |
495 | 490 | | |
496 | 491 | | |
497 | 492 | | |
498 | 493 | | |
499 | | - | |
| 494 | + | |
500 | 495 | | |
501 | 496 | | |
502 | 497 | | |
| |||
0 commit comments