Hi,
-
I'm using default IMemoryCache, which keeps reference to object, so when i get value from cache and change something with it, this change apply to whole cache. Is it possible that memorycache return deepcloned objects on Get? I guess solution could be to pass custom implementation of IMemoryCache which deepclone objects on read. Do you know some other implementations of IMemoryCachen which can be used to achive that? Or mayby there is other way to do that?
-
I have simple code, get from cache, update value, and Set to cache again, everything is in Redis Redlock block
using var redLock = await LockHelper.AquireLockAsync(key)...
var result = await _fusionCache.TryGetAsync....
result = ProcessResult(result)...
await _fusionCache.SetAsync(key, result...
is it better way to do that? Mayby some specialized method which could be used like this:
_fusionCache.UpateAsync(key, ProccessResult)
Hi,
I'm using default IMemoryCache, which keeps reference to object, so when i get value from cache and change something with it, this change apply to whole cache. Is it possible that memorycache return deepcloned objects on Get? I guess solution could be to pass custom implementation of IMemoryCache which deepclone objects on read. Do you know some other implementations of IMemoryCachen which can be used to achive that? Or mayby there is other way to do that?
I have simple code, get from cache, update value, and Set to cache again, everything is in Redis Redlock block
is it better way to do that? Mayby some specialized method which could be used like this: