I have channelPrefix declared in my connection string and I can tell by using ConfigurationOptions.Parse that it is correctly parsing out the channelPrefix from the string. I assumed that if I opened two instances of Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache where they each had the same connection string, except for different channelPrefix values, that Redis would maintain separate values for the keys of the two, but that is not what I am seeing. When I set a value to a key using one instance of RedisCache, I can retrieve the value from the other instance using the same key. Am I totally misunderstanding what channelPrefix does or is it possible that our Redis server is configured in a way that does not obey channelPrefix?
相关问题
- Getting Redis Master address from Sentinel C#
- Configuring Redis to play nice with AppHarbor
- Why do we need Redis for running CKAN?
- Problem in deserialize redis-cache to objects in S
- wait for all promises to finish in nodejs with blu
The concept of a "channel", and the
RedisChannel
type in particular, relates to the pub/sub API, not the keyspace DB API. For what you want, you are after the.WithKeyPrefix()
extension method on theIDatabase
that you obtained withGetDatabase()
.