-
-
Notifications
You must be signed in to change notification settings - Fork 456
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
How about Contains / Exists implementation for a key? #46
Comments
Yup, sounds like a potential improvement |
I'm a bit surprised that this is missing, it's a basic feature for a cache manager ! |
@killergege That's the normal behavior of caches. If the key doesn't exist, you cannot return anything. And CacheManager returns default(TCacheValue) which is null for value types etc... The only other option would be throwing a not found exception, which would cause all kinds of other oddness because then you'd have to try/catch every cache call... Which is even worse than a null check... That being said, a TryGet and/or Exists method will be helpful for non value types. |
Agreed with MichaC. Null is a meaningless value. If you want a way to reify
|
+1 - we would really like this feature too. We have cache loading algorithms that we want to transfer from a previous caching implementation that need to test for the existence of keys without transferring any values from the Redis layer, otherwise performance suffers. For now I'll have to plug this gap manually, would be great to have official support in the CacheManager API. |
@sam-piper @keerthivasanm |
It really helps if the value is a huge payload.
The text was updated successfully, but these errors were encountered: