-
Hello, A weird behavior I encountered when using FusionCache: In my application I setup Memory cache and the Distributed cache which is targeting one Redis cluster in Azure. I call Fusioncache Some small repros business code await _fusionCache.GetOrSetAsync<T>(
CacheUtilities.BuildCacheKey(orgName, tenantName, serviceType),
async _ =>
{
// await calling DB
},
options =>
{
if (conditional check if we don't do caching at all)
{
options.SetSkipDistributedCacheRead(true);
options.SetSkipDistributedCacheWrite(true, true);
options.SetSkipMemoryCacheRead();
options.SetSkipMemoryCacheWrite();
}
}); Startup RedisCacheSettings redisCacheSettings = Configuration.GetSection(nameof(RedisCacheSettings)).Get<RedisCacheSettings>();
services
.AddFusionCache()
.WithDistributedCache(new Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache(new RedisCacheOptions() { Configuration = redisCacheSettings.ConnectionString }))
.WithSerializer(new FusionCacheSystemTextJsonSerializer())
.WithBackplane(new RedisBackplane(new RedisBackplaneOptions { Configuration = redisCacheSettings.ConnectionString })); And the fusion cache trace log says
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Currently no founding so far. I've checked the Redis instance and there is only one db (db0) in place |
Beta Was this translation helpful? Give feedback.
Okay, after reading the docuementation again and read the source code a bit. I finally understand the
v2
is actually the wire format of the cache key. It is by design