Reputation:
I'm adding Redis in my ASP.NET Core project and using Microsoft.Extensions.Caching.StackExchangeRedis
to set it up (i.e. services.AddStackExchangeRedisCache(opts => ... )
). opt
is of type RedisCacheOptions
, one of properties is the one in question - RedisCacheOptions.InstanceName
. I was not able to find a lot of info about it (except that it is Redis instance name) and I'm wondering when it should be set up and what it is used for (right now everything is working on my machine without setting it up)?
Upvotes: 15
Views: 8728
Reputation: 1322
It seems the instance name can be used if you want to use your cache with multiple apps/services.
If you look into the source code for RedisCache.cs, you see in the constructor a comment describing the usage:
Upvotes: 20