-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QUESTION] Can you tell if the cache hit comes from Memory or Distributed? #194
Comments
Hi @JarrodOsborne and thanks for using FusionCache! Currently there's no way to know that when getting a value, but let me ask how are you approaching the cloning itself? Maybe I can think of something, you are not the first one to think about wanting to clone objects you got back from the cache. |
Closing as there has not been a response. |
Hi @jodydonetti
and providing this version of IMemoryCache to FusionCache. The clone is just a JSON copy
|
Hi @JarrodOsborne , oooh that is smart, I haven't thought about it! Glad it worked out in the end. |
@jodydonetti Going back to the original question, would this feature be considered in the future? I understand it's a little niche, but now I'm at the stage where I'm logging the duration of my cache operations and it would be nice to know what layer I'm hitting. |
Hi @JarrodOsborne , I'm not planning it right now, but I'm still thinking about how it could be made without a major change in the api surface area. Do you have any hints or ideas you'd like to share? |
Hi all, Auto-Cloning is coming in v1.3.0 which will be out... I think later today 😬 Will update later. |
Hi all, v1.3.0 is out 🥳 |
I have a multi-layer FusionCache set up (in-memory & Redis).
My issue is that objects retrieved from the memory store need to be immutable, so I will likely have to clone them upon retrieval.
However I don't want to clone if the hit comes from Redis as that would be pointless. Is there a way to determine if the cache item retrieved came from in-memory or distributed?
The text was updated successfully, but these errors were encountered: