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
Available since 2.0
Return to top