Showing posts with label Outputcache. Show all posts
Showing posts with label Outputcache. Show all posts

Saturday, August 9, 2008

Asp.net Directive :OutputCache

OutputCache as name suggest use to handle caching concept.

It handles/control caching policies for asp.net pages or controls,
users can handle caching programmatically also.

Attributes are

Duration
The time, in seconds, that the page or user control is cached. Setting this attribute on a page or user control establishes an expiration policy for HTTP responses from the object and will automatically cache the page or user control output.
Location:

To specify the location to store the output cache.
To store the output cache on the browser client where the request originated set the value as ‘Client’.
To store the output cache on any HTTP 1.1 cache-capable devices including the proxy servers and the client that made request, specify the Location as Downstream.
To store the output cache on the Web server, mention the location as Server.

VaryByControl: List of strings used to vary the output cache of a user Control, separated with semi-colon.
A semicolon-separated list of strings used to vary a user control's output cache. These strings represent the ID property values of ASP.NET server controls declared in the user control.

VaryByParam: List of strings used to vary the output cache, separated with semi-colon.

A semicolon-separated list of strings used to vary the output cache. By default, these strings correspond to a query string value sent with GET method attributes, or a parameter sent using the POST method. When this attribute is set to multiple parameters, the output cache contains a different version of the requested document for each specified parameter. Possible values include none, *, and any valid query string or POST parameter name.

VaryByCustom:
String of values, specifies the custom output caching requirements.

VaryByHeader: List of HTTP headers used to vary the output cache, separated with semi-colon.
A semicolon-separated list of HTTP headers used to vary the output cache. When this attribute is set to multiple headers, the output cache contains a different version of the requested document for each specified header.