This documentation is archived and is not being maintained.

HttpCachePolicyWrapper Class

Encapsulates the HTTP intrinsic object that contains methods for setting cache-specific HTTP headers and for controlling the ASP.NET page output cache.


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

public class HttpCachePolicyWrapper : HttpCachePolicyBase

The HttpCachePolicyWrapper type exposes the following members.

Public methodHttpCachePolicyWrapperInitializes a new instance of the HttpCachePolicyWrapper class.

Public propertyVaryByContentEncodingsGets the list of Content-Encoding headers that will be used to vary the output cache. (Overrides HttpCachePolicyBase.VaryByContentEncodings.)
Public propertyVaryByHeadersGets the list of all HTTP headers that will be used to vary cache output. (Overrides HttpCachePolicyBase.VaryByHeaders.)
Public propertyVaryByParamsGets the list of parameters received by an HTTP GET or HTTP POST that affect caching. (Overrides HttpCachePolicyBase.VaryByParams.)

Public methodAddValidationCallbackRegisters a validation callback for the current response. (Overrides HttpCachePolicyBase.AddValidationCallback(HttpCacheValidateHandler, Object).)
Public methodAppendCacheExtensionAppends the specified text to the Cache-Control HTTP header. (Overrides HttpCachePolicyBase.AppendCacheExtension(String).)
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSetAllowResponseInBrowserHistoryMakes the response available in the browser history cache, regardless of the HttpCacheability setting made on the server. (Overrides HttpCachePolicyBase.SetAllowResponseInBrowserHistory(Boolean).)
Public methodSetCacheability(HttpCacheability)Sets the Cache-Control header to the specified HttpCacheability value. (Overrides HttpCachePolicyBase.SetCacheability(HttpCacheability).)
Public methodSetCacheability(HttpCacheability, String)Sets the Cache-Control header to the specified HttpCacheability value and appends an extension to the directive. (Overrides HttpCachePolicyBase.SetCacheability(HttpCacheability, String).)
Public methodSetETagSets the ETag HTTP header to the specified string. (Overrides HttpCachePolicyBase.SetETag(String).)
Public methodSetETagFromFileDependenciesSets the ETag HTTP header based on the time stamps of the handler's file dependencies. (Overrides HttpCachePolicyBase.SetETagFromFileDependencies().)
Public methodSetExpiresSets the Expires HTTP header to an absolute date and time. (Overrides HttpCachePolicyBase.SetExpires(DateTime).)
Public methodSetLastModifiedSets the Last-Modified HTTP header to the specified date and time. (Overrides HttpCachePolicyBase.SetLastModified(DateTime).)
Public methodSetLastModifiedFromFileDependenciesSets the Last-Modified HTTP header based on the time stamps of the handler's file dependencies. (Overrides HttpCachePolicyBase.SetLastModifiedFromFileDependencies().)
Public methodSetMaxAgeSets the Cache-Control: max-age HTTP header to the specified time span. (Overrides HttpCachePolicyBase.SetMaxAge(TimeSpan).)
Public methodSetNoServerCachingStops all origin-server caching for the current response. (Overrides HttpCachePolicyBase.SetNoServerCaching().)
Public methodSetNoStoreSets the Cache-Control: no-store HTTP header. (Overrides HttpCachePolicyBase.SetNoStore().)
Public methodSetNoTransformsSets the Cache-Control: no-transform HTTP header. (Overrides HttpCachePolicyBase.SetNoTransforms().)
Public methodSetOmitVaryStarSpecifies whether the response contains the vary:* header when varying by parameters. (Overrides HttpCachePolicyBase.SetOmitVaryStar(Boolean).)
Public methodSetProxyMaxAgeSets the Cache-Control: s-maxage HTTP header to the specified time span. (Overrides HttpCachePolicyBase.SetProxyMaxAge(TimeSpan).)
Public methodSetRevalidationSets the Cache-Control HTTP header to either the must-revalidate or the proxy-revalidate directives, based on the specified enumeration value. (Overrides HttpCachePolicyBase.SetRevalidation(HttpCacheRevalidation).)
Public methodSetSlidingExpirationSets cache expiration to absolute or sliding. (Overrides HttpCachePolicyBase.SetSlidingExpiration(Boolean).)
Public methodSetValidUntilExpiresSpecifies whether the ASP.NET cache should ignore HTTP Cache-Control headers sent by the client that invalidate the cache. (Overrides HttpCachePolicyBase.SetValidUntilExpires(Boolean).)
Public methodSetVaryByCustomSpecifies a text string to vary cached output responses by. (Overrides HttpCachePolicyBase.SetVaryByCustom(String).)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

The HttpCachePolicyWrapper class derives from the HttpCachePolicyBase class and serves as a wrapper for the HttpCachePolicy class. This class exposes the functionality of the HttpCachePolicy class while also exposing the HttpCachePolicyBase type. The HttpCachePolicyBase class enables you to replace the original implementation of the HttpCachePolicy class in your application with a custom implementation, such as when you perform unit testing outside the ASP.NET pipeline.

.NET Framework

Supported in: 4, 3.5 SP1

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.

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