Skip to content

Enhancement to IDistributedCache - Allow for bulk remove and key enumeration #44512

Open
@maryamariyan

Description

@maryamariyan

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:

  • When using caching in extensions, we don't want to allow enumerating on keys while elements may get removed within another thread, (keeping as atomic operation). In order to allow for (e.g. bulk remove) we can offer returning a snapshot (say array of elements. For example to allow for bulk remove of items with a certain prefix (e.g. "ZZZ"), given a snapshot, we may use TryGetValue and if already gone it would not throw.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bottom Up WorkNot part of a theme, epic, or user storyEpicGroups multiple user stories. Can be grouped under a theme.Team:LibrariesUser StoryA single user-facing feature. Can be grouped under an epic.area-Extensions-Caching

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions