MemoryOutputCacheStore doesn't respect "reason" for eviction and deletes tags erroneously #61524
Labels
area-middleware
Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares
feature-output-caching
aspnetcore/src/Middleware/OutputCaching/src/Memory/MemoryOutputCacheStore.cs
Line 132 in 2c0bb03
If an OutputCache entry is created with tags, and then is replaced, the PostEvictionCallback that is registered (
RemoveFromTags
) will remove tags, even though a new cache entry item has replaced the old cache entry.The tags are then lost as the old entry's eviction has deleted the new entry's tags.
It seems like there needs to be some sort of state saved with the
_taggedEntries
(maybe just a guid?) And that state needs to be passed to the PostEvictionCallback so that only the tags that were registered with the correct entry are removed.The RedisOutputCacheStore seems to function correctly.
The text was updated successfully, but these errors were encountered: