This topic has not yet been rated - Rate this topic

HttpCachePolicy Class

Contains methods for setting cache-specific HTTP headers and for controlling the ASP.NET page output cache.

System.Object
  System.Web.HttpCachePolicy

Namespace:  System.Web
Assembly:  System.Web (in System.Web.dll)
public sealed class HttpCachePolicy

The HttpCachePolicy type exposes the following members.

  Name Description
Public property VaryByContentEncodings Gets the list of Content-Encoding headers that will be used to vary the output cache.
Public property VaryByHeaders Gets the list of all HTTP headers that will be used to vary cache output.
Public property VaryByParams Gets the list of parameters received by an HTTP GET or HTTP POST that affect caching.
Top
  Name Description
Public method AddValidationCallback Registers a validation callback for the current response.
Public method AppendCacheExtension 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 Makes the response is available in the client browser History cache, regardless of the HttpCacheability setting made on the server, when the allow parameter is true.
Public method SetCacheability(HttpCacheability) Sets the Cache-Control header to one of the values of HttpCacheability.
Public method SetCacheability(HttpCacheability, String) Sets the Cache-Control header to one of the values of HttpCacheability and appends an extension to the directive.
Public method SetETag Sets the ETag HTTP header to the specified string.
Public method SetETagFromFileDependencies Sets the ETag HTTP header based on the time stamps of the handler's file dependencies.
Public method SetExpires Sets the Expires HTTP header to an absolute date and time.
Public method SetLastModified Sets the Last-Modified HTTP header to the DateTime value supplied.
Public method SetLastModifiedFromFileDependencies Sets the Last-Modified HTTP header based on the time stamps of the handler's file dependencies.
Public method SetMaxAge Sets the Cache-Control: max-age HTTP header based on the specified time span.
Public method SetNoServerCaching Stops all origin-server caching for the current response.
Public method SetNoStore Sets the Cache-Control: no-store HTTP header.
Public method SetNoTransforms Sets the Cache-Control: no-transform HTTP header.
Public method SetOmitVaryStar Specifies whether the response should contain the vary:* header when varying by parameters.
Public method SetProxyMaxAge Sets the Cache-Control: s-maxage HTTP header based on the specified time span.
Public method SetRevalidation Sets the Cache-Control HTTP header to either the must-revalidate or the proxy-revalidate directives based on the supplied enumeration value.
Public method SetSlidingExpiration Sets cache expiration to from absolute to sliding.
Public method SetValidUntilExpires Specifies whether the ASP.NET cache should ignore HTTP Cache-Control headers sent by the client that invalidate the cache.
Public method SetVaryByCustom Specifies a custom text string to vary cached output responses by.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Top

For background information about HTTP headers and controlling caching, see RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1, available on the World Wide Web Consortium (W3C) Web site.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, 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.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ