System.Web.UI.Page.InitOutputCache Method

Initializes the output cache for the current page request.

Syntax

protected virtual void InitOutputCache (int duration, string varyByContentEncoding, string varyByHeader, string varyByCustom, OutputCacheLocation location, string varyByParam)

Parameters

duration
The amount of time that objects stored in the output cache are valid.
varyByContentEncoding
A semicolon-separated list of character-sets (content encodings) that content from the output cache will vary by.
varyByHeader
A semicolon-separated list of headers that content from the output cache will vary by.
varyByCustom
The Vary HTTP header.
location
One of the System.Web.UI.OutputCacheLocation values.
varyByParam
A semicolon-separated list of parameters received by a GET or POST method that content from the output cache will vary by.

Remarks

You should not call this method. To enable and manipulate output caching for a page, use either the @ OutputCache directive in the .aspx file, or methods and properties of the System.Web.HttpCachePolicy class. The latter are accessible through Response.Cache syntax in the page's code. For more information, see Caching ASP.NET Pages.

Requirements

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