Closed Jogai closed 6 years ago
The old asp.net outputcache stuff is pretty limited in regards what you can do. No, there is no way to do anything profile specific. If you need more flexibility, I'd suggest to not use outputcache at all. Or, you can also write your own output cache provider (you can use the code of this one as template...) and play with it/customize it
Ok thanks for the answer. I use mvcdonutcaching to make it a bit more useful. The cachemanager is set as the cache provider. That way I can clear the output cache trough the cache.Clear() method. But I do see some delay before I see the output cache actually cleared.
Config to make it work together for the curious:
<caching>
<outputCache defaultProvider="CacheManagerOutputCacheProvider">
<providers>
<add cacheName="websiteCache" name="CacheManagerOutputCacheProvider"
type="CacheManager.Web.CacheManagerOutputCacheProvider, CacheManager.Web" />
</providers>
</outputCache>
<outputCacheSettings>
<outputCacheProfiles>
<add name="Indexes" duration="1" varyByParam="*" varyByHeader="host" />
</outputCacheProfiles>
</outputCacheSettings>
</caching>
Is there some delay before a controller action output cache is really invalidated after calling cache.Clear();
And is it possible to target clearing outputcaches more specifically. For example per outputCacheProfile, or even better in my case, per host (in a multi tenant set up).