
Structuring an ASP.NET Page | 41
Web Forms
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
VaryByCustom
Specifies a custom caching variation scheme. Setting the value to browser
varies the cache based on the name and major version number of the
client’s browser. To use this attribute for any other custom value, you
must override the GetVaryByCustomString method of the
HttpAp-
plication
class in the global.asax file.
VaryByHeader (pages only)
Specifies a list of one or more HTTP headers, delimited by semicolons,
to be used to vary the output cache. Requests with identical values for
the specified headers will be served a cached version of the page (if one
exists). If no matching page exists in the cache, the page is processed and
the resulting output is cached. This attribute is supported only for
output caching with ASP.NET pages. Attempting to use this attribute for
caching user controls will result in a parser error.
VaryByParam
Specifies a list of one or more HTTP GET or POST parameters, delim-
ited by semicolons, to be used to vary the output cache. Requests with
identical values for the specified parameters will receive a cached version
of the page (if one exists). If no matching page exists in the cache, the
page is processed and the resulting output is cached. This attribute is
required. To disable varying the cache by parameter, ...