-
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
Enhancement to IDistributedCache - Allow for bulk remove and key enumeration #44512
Comments
Tagging subscribers to this area: @eerhardt, @maryamariyan Issue meta data
|
Added corresponding tests scenarios as well. As part of dotnet#44512
@maryamariyan, Is there a concern I'm missing? |
I wonder if it is being worked on. I recently stumbled upon a case when I very much need to enumerate values (or keys at least) by pattern (prefix), otherwise I will have to use underlying caching solution directly, which breaks my abstractions. |
It looks like this has been added to the .NET 6.0 milestone (tentatively sched to be released in November 2021 - https://devblogs.microsoft.com/dotnet/announcing-net-6-preview-2/#:~:text=.NET%206%20will%20be%20released,Term%20Support%20(LTS)%20release. |
We've reached feature complete for .NET 6. Moving to 7. |
So this is being bumped again to .NET 8 now? |
@avisra this is still being considered for 7.0 as a nice to have but not committed |
@avisra I was looking to learn more about how IDistrbutedCache is being used? do you have sample code snippets to share to kick this off? |
@maryamariyan I am currently using IDistributedCache for caching data in my application (and for caching things within my IdentityServer instance). On my deployed application, I am configuring my cache to use Redis. Locally, I am using in-memory. But regardless of the provider, it is going through IDistributedCache. My goal for this ticket is to be able to enumerate the cache without identifying the provider. I'd like to have a page in the administration of my application which displays a table with all of the objects in my cache (by key) and have a button for deleting/revalidating, etc. The only piece missing from this, which I'm hoping this ticket can provider, is the ability to enumerate the objects in the cache collection. |
@avisra Here are a couple of potential interface additions for
usage:
|
It seems that this is already possible with libraries such as EasyCaching. |
As @eerhardt and I were triaging through caching extensions issues, we noticed a theme of requests being around allowing for key enumeration and bulk removal of items in IDistributedCache:
We closed a number of items as dupes of the above issues as well.
More information on the intricacies of this issue and ways to approach it:
The text was updated successfully, but these errors were encountered: