This documentation is archived and is not being maintained.

PageAdapter::CacheVaryByHeaders Property

Gets a list of additional HTTP headers by which caching is varied for the Web page to which this derived page adapter is attached.

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

public:
virtual property StringCollection^ CacheVaryByHeaders {
	StringCollection^ get ();
}

Property Value

Type: System.Collections.Specialized::StringCollection
An IList that contains a list of HTTP headers; otherwise, nullptr.

Entities on the Web that cache Web pages cache multiple versions, based on the HTTP headers and other factors. For example, a version for each language in which a page is generated is typically cached, based on the Accept-Language HTTP header.

For specific browsers, it might be necessary to vary caching by HTTP headers in addition to the headers that control target-independent caching. For example, it might be necessary to cache different versions of a page for different screen sizes.

The header names returned by the CacheVaryByHeaders property are added to the list of headers on the Vary HTTP header sent to the client browser.

Notes to Inheritors:

When you inherit from the PageAdapter class, you can override the CacheVaryByHeaders property to return a list of the additional headers to control target-specific caching. The CacheVaryByHeaders base property returns nullptr.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Show: