Assembly: EPiServer (in EPiServer.dll) Version: 8.0.0
public class ContentOutputCacheAttribute : OutputCacheAttribute
Attribute that can be used to specify that the output from a action should be put in output cache.
|ContentOutputCacheAttribute Constructor||Initializes a new instance of the ContentOutputCacheAttribute class.||public|
|GetIdentity||Extracts the identity from the object if it has one.||public, static|
|GetOriginalType||Gets the Type of the current object, ensuring that the eventual type that could be generated by a proxy interceptor is ignored.||public, static|
|OnActionExecuting||This method is an implementation of OnActionExecuting(ActionExecutingContext) and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code.||public|
|OnResultExecuting||Called before the action result executes.||public|
|SetIdentity||Sets the identity into the object if supported||public, static|
|ToPropertyBag(Object)||Create a PropertyBag instance and populates it with its properties The algorith for extracting properties is as follows: 1) Property must a have a getter and setter 2a) Getter must be public OR 2b) The class must be marked either with the DataContractAttribute or EPiServerDataContractAttribute and the property must be marked either with the DataMemberAttribute or EPiServerDataMemberAttribute||public, static|
|ToPropertyBag(Object, IEnumerable(String))||Create a PropertyBag instance and populates it with its properties||public, static|
|ConfigurationSettings||Gets or sets the configuration settings.||public|
|ContentLoader||Gets or sets the content loader.||public|
|Disable||Gets or sets a value indicating whether this ContentOutputCacheAttribute is disabled.||public|
|UseOutputCacheValidator||Gets or sets the use output cache validator.||public|
This attibute cannot be used on child actions. The reason for this is that in MVC child actions are output cached in a memory cache and hence the output cache will not be invalidated when a content is changed.The output cache is turned on based on the following criteria:
1. The httpCacheExpiration in web.config is > 0.
2. The current user must not be logged on, aka Anonymous.
3. The request must be a GET type request. Hence, Postbacks and form postings will not be cached.
4. The current content must be the published version (the WorkID is == 0).
Some cache parameters are fetched from configruation if not present on attribute. More specifically if Duration is 0 then the httpCacheExpiration (on element/episerver/sites/site/SiteSetting) value from web.config is used. And if VaryByCustom is null or empty then httpCacheVaryByCustom (on element/episerver/sites/site/SiteSetting) value from web.config is used. Cache item expiration is set to the httpCacheExpiration setting, which is the number of seconds the item should reside in the cache, as long as the IVersionable.StopPublish value of the content is not less than the policy timeout (in which case, the StopPublish value is used).