You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OutputCache is currently using the Ids of the displayed ContentItems as tags for the OutputCache.
In a few of our applications, we've found this somewhat limiting, so we've had to find workarounds, in cases where a content that isn't, strictly speaking, being displayed nonetheless is relevant to what should be shown, and a change in its state should cause the output cache to be evicted. A common example would be some setting or configuration item.
We propose adding an interface allowing injection of additional tags, so it's easier for features to control the eviction of elements from output cache.
The new interface would look something like:
public interface ITagsProvider : IDependency {
IEnumerable<string> GetTags();
}
In the OutputCacheFilter we would then inject a IEnumerable<ITagsProvider > _tagsProviders, that we would use (syntax is approximate):
What about the other way around, a service in the output cache that allows to add custom tags to the current request. This way modules won't have to store what has changed until the output cache calls them.
If I understand what you are saying, you mean something that works like the IDisplayedContentItemHandler, but rather than being invoked only on the BuildDisplay (because it's a ContentHandler), it would be possible to invoke it at any point in the code.
Orchard/src/Orchard.Web/Modules/Orchard.OutputCache/Filters/OutputCacheFilter.cs
Line 261 in 028e2e4
OutputCache is currently using the Ids of the displayed ContentItems as tags for the OutputCache.
In a few of our applications, we've found this somewhat limiting, so we've had to find workarounds, in cases where a content that isn't, strictly speaking, being displayed nonetheless is relevant to what should be shown, and a change in its state should cause the output cache to be evicted. A common example would be some setting or configuration item.
We propose adding an interface allowing injection of additional tags, so it's easier for features to control the eviction of elements from output cache.
The new interface would look something like:
In the
OutputCacheFilter
we would then inject aIEnumerable<ITagsProvider > _tagsProviders
, that we would use (syntax is approximate):Each feature where we would implement one of these would then be able to cause its own cache evictions through its own tags.
The text was updated successfully, but these errors were encountered: