-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: further tags for output cache #8641
Comments
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
Anywhere in code:
In the
Is that correct? |
Exactly. |
Look around orchard core, we might already be doing that. |
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: