dotnet / dotnet/aspnetcore

[StackExchange.Redis] Add DefaultReadCommandFlag into RedisCacheOptions for read operations

Open
#28,375 6 comments 2 reactions 0 assignees View on GitHub
area-middleware enhancement feature-caching help wanted
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

### Is your feature request related to a problem? Please describe.
I am trying to hookup `RedisCache` to multiple nodes in AWS ElastiCache. I have 1 primary node and _n_ replication nodes. Currently when configuring `RedisCacheOptions.ConfigurationOptions` with multiple `Endpoint`s, `RedisCache` doesn't read from the replication nodes.

### Describe the solution you'd like
In StackExchange.Redis there is a `CommandFlags` enum that will allow us to `PreferSlave`. I would like to add another property along the lines of `DefaultReadCommandFlag` to `RedisCacheOptions` for read commands. This will allow us to specify `PreferSlave` and distribute load across the replication nodes.

Command Flags: https://github.com/StackExchange/StackExchange.Redis/blob/c72ffa8413572262b8eb9f8f4e0c5da07f856359/src/StackExchange.Redis/Enums/CommandFlags.cs#L27-L47

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.