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
Add flexible_cluster_mode config for Redis Cluster compatibility
This adds a new configuration option 'flexible_cluster_mode' that enables
sequential operations in Cache::flexible() for Redis Cluster compatibility.
Implementation:
- When 'flexible_cluster_mode' is enabled, flexible() uses sequential get/put
operations instead of bulk many()/putMany() operations
- This avoids CROSSSLOT errors in Redis Cluster environments where keys hash
to different slots
- Default is false to maintain existing behavior
Configuration (config/cache.php):
```php
'stores' => [
'redis' => [
'driver' => 'redis',
'flexible_cluster_mode' => env('CACHE_FLEXIBLE_CLUSTER_MODE', false),
],
],
```
Trade-offs:
- Sequential mode: 2 network round-trips instead of 1
- Performance impact is minimal since flexible() callback execution dominates
- This approach already exists for putMany() in cluster connections
All tests pass (75 tests, 302 assertions).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments