-
Couldn't load subscription status.
- Fork 10.5k
Closed
Labels
✔️ Resolution: DuplicateResolved as a duplicate of another issueResolved as a duplicate of another issueStatus: Resolvedarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsfeature-cachingIncludes: StackExchangeRedis and SqlServer distributed cachesIncludes: StackExchangeRedis and SqlServer distributed caches
Description
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
Metadata
Metadata
Assignees
Labels
✔️ Resolution: DuplicateResolved as a duplicate of another issueResolved as a duplicate of another issueStatus: Resolvedarea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsfeature-cachingIncludes: StackExchangeRedis and SqlServer distributed cachesIncludes: StackExchangeRedis and SqlServer distributed caches