We can use Tag like that with Minimal API's .CacheOutput(x=x.Tag("people")); So that we can use IOutputCacheStore.EvictByTag("people");.
But when it comes to controllers, we have to use [CacheOutput] attribute which does not have 'Tag'. There is no such usage like [CacheOutput(Tag="people)] so that I can not use EvictByTag(). I don't want to migrate all my controllers to minimal API's. Is there a way to use Tag with controllers?
CacheOutputbuilds cache policy which is applied to particular mapped endpoint. You can declare policy when adding services for output cache and pass policy name to the attribute: