System.Web.HttpCachePolicy.SetCacheability Method

Sets the Cache-Control header to one of the values of System.Web.HttpCacheability and appends an extension to the directive.

Syntax

public void SetCacheability (HttpCacheability cacheability, string field)

Parameters

cacheability
The System.Web.HttpCacheability enumeration value to set the header to.
field
The cache control extension to add to the header.

Remarks

The field name extension is valid only when used with the private or no-cache directives. For more information, see RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1, available on the tp://go.microsoft.com/fwlink/?linkid=37125.

This method will throw an invalid argument exception if incompatible directives and extensions are combined.

HttpCachePolicy.SetCacheability(HttpCacheability, string) is introduced in the .NET Framework version 3.5. For more information, see The .NET Framework 3.5 Architecture.

Requirements

Namespace: System.Web
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0