HttpCachePolicyBase Class (System.Web)

Switch View :
ScriptFree
.NET Framework Class Library
HttpCachePolicyBase Class

Serves as the base class for classes that contain methods for setting cache-specific HTTP headers and for controlling the ASP.NET page output cache.

Inheritance Hierarchy

System.Object
  System.Web.HttpCachePolicyBase
    System.Web.HttpCachePolicyWrapper

Namespace:  System.Web
Assembly:  System.Web (in System.Web.dll)
Syntax

Visual Basic
Public MustInherit Class HttpCachePolicyBase
C#
public abstract class HttpCachePolicyBase
Visual C++
public ref class HttpCachePolicyBase abstract
F#
[<AbstractClass>]
type HttpCachePolicyBase =  class end

The HttpCachePolicyBase type exposes the following members.

Constructors

  Name Description
Protected method HttpCachePolicyBase Initializes the class for use by an inherited class instance. This constructor can only be called by an inherited class.
Top
Properties

  Name Description
Public property VaryByContentEncodings When overridden in a derived class, gets the list of Content-Encoding headers that are used to vary the output cache.
Public property VaryByHeaders When overridden in a derived class, gets the list of all HTTP headers that are used to vary cache output.
Public property VaryByParams When overridden in a derived class, gets the list of parameters that are received by an HTTP GET or POST verb that affect caching.
Top
Methods

  Name Description
Public method AddValidationCallback When overridden in a derived class, registers a validation callback for the current response.
Public method AppendCacheExtension When overridden in a derived class, appends the specified text to the Cache-Control HTTP header.
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method SetAllowResponseInBrowserHistory When overridden in a derived class, makes the response available in the browser history cache, regardless of the HttpCacheability setting made on the server.
Public method SetCacheability(HttpCacheability) When overridden in a derived class, sets the Cache-Control header to the specified HttpCacheability value.
Public method SetCacheability(HttpCacheability, String) When overridden in a derived class, sets the Cache-Control header to the specified HttpCacheability value and appends an extension to the directive.
Public method SetETag When overridden in a derived class, sets the ETag HTTP header to the specified string.
Public method SetETagFromFileDependencies When overridden in a derived class, sets the ETag HTTP header based on the time stamps of the handler's file dependencies.
Public method SetExpires When overridden in a derived class, sets the Expires HTTP header to an absolute date and time.
Public method SetLastModified When overridden in a derived class, sets the Last-Modified HTTP header to the specified date and time.
Public method SetLastModifiedFromFileDependencies When overridden in a derived class, sets the Last-Modified HTTP header based on the time stamps of the handler's file dependencies.
Public method SetMaxAge When overridden in a derived class, sets the Cache-Control: max-age HTTP header to the specified time span.
Public method SetNoServerCaching When overridden in a derived class, stops all origin-server caching for the current response.
Public method SetNoStore When overridden in a derived class, sets the Cache-Control: no-store HTTP header.
Public method SetNoTransforms When overridden in a derived class, sets the Cache-Control: no-transform HTTP header.
Public method SetOmitVaryStar When overridden in a derived class, specifies whether the response contains the vary:* header when caching varies by parameters.
Public method SetProxyMaxAge When overridden in a derived class, sets the Cache-Control: s-maxage HTTP header to the specified time span.
Public method SetRevalidation When overridden in a derived class, sets the Cache-Control HTTP header to either the must-revalidate or the proxy-revalidate directives, based on the specified enumeration value.
Public method SetSlidingExpiration When overridden in a derived class, sets cache expiration to absolute or sliding.
Public method SetValidUntilExpires When overridden in a derived class, specifies whether the ASP.NET cache should ignore HTTP Cache-Control headers that are sent by the client that invalidate the cache.
Public method SetVaryByCustom When overridden in a derived class, specifies a text string to vary cached output responses by.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Top
Remarks

The HttpCachePolicyBase class is an abstract class that contains the same members as the HttpCachePolicy class. The HttpCachePolicyBase class lets you create derived classes that are like the HttpCachePolicy class, but that you can customize and that work outside the ASP.NET pipeline. When you perform unit testing, you typically use a derived class to implement members with customized behavior that fulfills the scenario you are testing.

The HttpCachePolicyWrapper class derives from the HttpCachePolicyBase class. The HttpCachePolicyWrapper class serves as a wrapper for the HttpCachePolicy class. At run time, you typically use an instance of the HttpCachePolicyWrapper class to call members of the HttpCachePolicy object.

Version Information

.NET Framework

Supported in: 4, 3.5 SP1
Platforms

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
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