Share via


OutputCacheAttribute Class

Definition

Specifies the parameters necessary for setting appropriate headers in output caching.

[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public sealed class OutputCacheAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type OutputCacheAttribute = class
    inherit Attribute
Public NotInheritable Class OutputCacheAttribute
Inherits Attribute
Inheritance
OutputCacheAttribute
Attributes

Remarks

This attribute requires the output cache middleware.

Constructors

OutputCacheAttribute()

Properties

Duration

Gets or sets the duration in seconds for which the response is cached.

NoStore

Gets or sets the value which determines whether the response should be cached or not. When set to true, the response won't be cached.

PolicyName

Gets or sets the value of the cache policy name.

Tags

Gets or sets tags to apply to the output cache.

VaryByHeaderNames

Gets or sets the header names to vary by.

VaryByQueryKeys

Gets or sets the query keys to vary by.

VaryByRouteValueNames

Gets or sets the route value names to vary by.

Applies to