Skip to content
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

HybridCache cache not removed by tag #58857

Closed
1 task done
mrazvanalex opened this issue Nov 10, 2024 · 5 comments
Closed
1 task done

HybridCache cache not removed by tag #58857

mrazvanalex opened this issue Nov 10, 2024 · 5 comments
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions feature-caching Includes: StackExchangeRedis and SqlServer distributed caches ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved

Comments

@mrazvanalex
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

HybridCache RemoveByTagAsync is not removing cache with certain tag when using MemoryCache

Expected Behavior

When running the controller method again, the cache should reset and get new data from myService because the cache should be removed for "identifier" as it has the tag "test" .

The cache is not removed.

Steps To Reproduce

Controller Method

           var tags = new List<string> { id.ToString() };
            var entryOptions = new HybridCacheEntryOptions
            {
                Expiration = TimeSpan.FromMinutes(1),
                LocalCacheExpiration = TimeSpan.FromMinutes(1)
            };

            var result = await _cache.GetOrCreateAsync($"identifier", async get =>
            {
                var result = await _myService.GetData();
                return result;
            }, entryOptions, tags);

Trying to remove cache entry:
` await _cache.RemoveByTagAsync(id.ToString());

Yes, I confirmed that the GUID is the same.

Exceptions (if any)

.NET Version

9.0.100-rc.2.24474.11

Anything else?

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically label Nov 10, 2024
@BrennanConroy
Copy link
Member

I don't think it's implemented yet.

Tracked by #55308

@BrennanConroy BrennanConroy added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Nov 10, 2024
@gfoidl gfoidl added feature-caching Includes: StackExchangeRedis and SqlServer distributed caches area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically labels Nov 11, 2024
@johanolofsson72
Copy link

Still not working with version: 9.0.0-preview.9.24556.5

@Mr-MooMoo
Copy link

I am having the same issue, also using 9.0.0-preview.9.24556.5.

@neozhu
Copy link

neozhu commented Dec 20, 2024

I am having the same issue, also using 9.0.0-preview.9.24556.5

@BrennanConroy
Copy link
Member

Once again, tags have not been implemented yet. Tags are currently being worked on in dotnet/extensions#5748

@dotnet dotnet locked as resolved and limited conversation to collaborators Dec 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions feature-caching Includes: StackExchangeRedis and SqlServer distributed caches ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved
Projects
None yet
Development

No branches or pull requests

6 participants