Export (0) Print
Expand All

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 StringCollection CacheVaryByHeaders { get; }

Property Value

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

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 null.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

© 2014 Microsoft