Compartilhar via


OutputCacheAttribute Class

[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]

Provides a declarative way to enable output caching.

Inheritance Hierarchy

System.Object
  System.Attribute
    System.ServiceModel.DomainServices.Server.OutputCacheAttribute

Namespace:  System.ServiceModel.DomainServices.Server
Assembly:  System.ServiceModel.DomainServices.Server (in System.ServiceModel.DomainServices.Server.dll)

Syntax

'Declaration
<AttributeUsageAttribute(AttributeTargets.Method Or AttributeTargets.Property Or AttributeTargets.Field, AllowMultiple := False,  _
    Inherited := True)> _
Public NotInheritable Class OutputCacheAttribute _
    Inherits Attribute
'Usage
Dim instance As OutputCacheAttribute
[AttributeUsageAttribute(AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false, 
    Inherited = true)]
public sealed class OutputCacheAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Method|AttributeTargets::Property|AttributeTargets::Field, AllowMultiple = false, 
    Inherited = true)]
public ref class OutputCacheAttribute sealed : public Attribute
[<SealedAttribute>]
[<AttributeUsageAttribute(AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false, 
    Inherited = true)>]
type OutputCacheAttribute =  
    class
        inherit Attribute
    end
public final class OutputCacheAttribute extends Attribute

The OutputCacheAttribute type exposes the following members.

Constructors

  Name Description
Public method OutputCacheAttribute(String) Initializes a new instance of the OutputCacheAttribute class with the specified cache profile.
Public method OutputCacheAttribute(OutputCacheLocation) Initializes a new instance of the OutputCacheAttribute class with the specified OutputCacheLocation.
Public method OutputCacheAttribute(OutputCacheLocation, Int32) Initializes a new instance of the OutputCacheAttribute class with the specified OutputCacheLocation and duration.

Top

Properties

  Name Description
Public property CacheProfile Gets the name of the cache settings.
Public property Duration Gets the duration in seconds for which the response should be cached.
Public property Location Gets the locations where caching can be applied.
Public property SqlCacheDependencies Gets or sets the SQL cache dependencies.
Public property TypeId (Inherited from Attribute.)
Public property UseSlidingExpiration Gets or sets a value that indicates whether the duration uses a sliding expiration or an absolute expiration.
Public property VaryByHeaders Gets or sets the headers on which a cached response is based.

Top

Methods

  Name Description
Public method Equals (Inherited from Attribute.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Attribute.)
Public method GetType (Inherited from Object.)
Public method IsDefaultAttribute (Inherited from Attribute.)
Public method Match (Inherited from Attribute.)
Protected method MemberwiseClone (Inherited from Object.)
Public method ToString (Inherited from Object.)

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method _Attribute.GetIDsOfNames (Inherited from Attribute.)
Explicit interface implemetationPrivate method _Attribute.GetTypeInfo (Inherited from Attribute.)
Explicit interface implemetationPrivate method _Attribute.GetTypeInfoCount (Inherited from Attribute.)
Explicit interface implemetationPrivate method _Attribute.Invoke (Inherited from Attribute.)

Top

Remarks

Use the cashing of output from method calls to improve performance. Apply the attribute to methods whose output you want to cache.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.ServiceModel.DomainServices.Server Namespace