Closed
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