I am trying to use the redis cache using the connection string approach and the defaultDatabase that I have specified in the connection string is not getting picked up when caching the data in redis.
My configuration looks like this:
<cacheManagerxmlns="http://cachemanager.michaco.net/schemas/CacheManagerCfg.xsd">
<managers>
<cachename="distributed-data-cache"enableStatistics="true"backplaneName="redis.cache"backplaneType="CacheManager.Redis.RedisCacheBackplane, CacheManager.StackExchange.Redis"serializerType="CacheManager.Serialization.Json.JsonCacheSerializer, CacheManager.Serialization.Json">
<handlename="default"ref="inmemoryHandle" />
<handlename="redis.cache"ref="redisHandle"isBackplaneSource="true" />
</cache>
<cachename="inmemory-data-cache"enableStatistics="true"serializerType="CacheManager.Serialization.Json.JsonCacheSerializer, CacheManager.Serialization.Json">
<handlename="default"ref="inmemoryHandle" />
</cache>
</managers>
<cacheHandles>
<handleDefid="inmemoryHandle"type="CacheManager.SystemRuntimeCaching.MemoryCacheHandle`1, CacheManager.SystemRuntimeCaching"defaultExpirationMode="Sliding"defaultTimeout="2m" />
<handleDefid="redisHandle"type="CacheManager.Redis.RedisCacheHandle`1, CacheManager.StackExchange.Redis"defaultExpirationMode="Sliding"defaultTimeout="5m" />
</cacheHandles>
</cacheManager>
Connection string is specified like this:
<connectionStrings>
<addname="redis.cache"connectionString="127.0.0.1:6379,allowAdmin=False,connectTimeout=500,defaultDatabase=3,ssl=False,abortConnect=False,connectRetry=3" />
</connectionStrings>
With this configuration - I expect the data to be written to database 3 in redis. However, it is getting written to database 0.
I am trying to use the redis cache using the connection string approach and the defaultDatabase that I have specified in the connection string is not getting picked up when caching the data in redis.
My configuration looks like this:
Connection string is specified like this:
With this configuration - I expect the data to be written to database 3 in redis. However, it is getting written to database 0.