-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Revisit MemoryCache design #36556
Comments
Putting this tentatively in 2.2.0. |
This is not currently in scope. We'll revisit in a future release. |
The fact that you have to |
@JunTaoLuo is this still needed? (Referring to aspnet/Caching#280 (comment)) Also since we have a Set extension method here: runtime/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/MemoryCacheExtensions.cs Lines 44 to 50 in 855e296
|
The point of the issue is that the pattern of using |
The current design is far from perfect. I agree that we need a re-design. Pplease follow #48567 which includes your proposal and some other good ideas. Thank you! |
The current design of MemoryCache is awkward due to the IMemoryCache interface where
ICacheEntry CreateEntry(object key)
exists instead of a more intuitiveSet(object key, object value)
. The expected usage pattern is to callDispose()
on theICacheEntry
to "commit" the entry to the cache but this is unintuitive as well. This proved to be an issue when attempting to implement a strategy based eviction trigger and strategy in aspnet/Caching#280. We should revisit this design and see if there are possible improvements.cc @davidfowl @DamianEdwards
The text was updated successfully, but these errors were encountered: