You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Some questions about the behavior of AddInternal function #390
As I understand it, if user add a cache to the CacheManager, the CacheManager should add cache item to each handle.
But the current implementation only add cache item into the last registered handle. [code here]
Here is a scenario, ServiceA is a cache write service, which registers a RuntimeCacheHandle and multiple RedisCacheHandle (Redis1 ~ Redis5) to write, and ServiceB is a cache read service, which registers a RuntimeCacheHandle and one RedisCacheHandle (Redis1).
if ServiceA use AddOrUpdate method to add a cache item, according to the current code logic, this cache item only write to Redis5, When ServiceB wants to get the cache item written by ServiceA from Redis1, this cache not exist because ServiceA not add this cache into Redis1.
I want to understand the intention of this design, looking forward to your reply.
The current quick solution is to call GetCacheItem function immediately after ServiceAAddOrUpdate, so that all cache items will be written to all handles, but this writing method will cause great ambiguity.
I guess if the purpose is to control. can we set a direction for each Handle, ReadWrite, WriteOnly, and ReadOnly?
When adding, filter out the ReadWrite and WriteOnly handles and add them one by one.
When reading, filter out the ReadWrite and ReadOnly handles and read them one by one.
Will this help improve the robustness of the component?
Activity
xingwen1987 commentedon Sep 22, 2025
The current quick solution is to call GetCacheItem function immediately after ServiceA AddOrUpdate, so that all cache items will be written to all handles, but this writing method will cause great ambiguity.
I guess if the purpose is to control. can we set a direction for each Handle, ReadWrite, WriteOnly, and ReadOnly?
Will this help improve the robustness of the component?