System.Web Namespace HttpCacheVaryByHeaders Class
Sets or retrieves a custom header field that the origin server adds to the Vary HTTP header.
In [ C# ], this property is the indexer for the HttpCacheVaryByHeaders class.
[ VB ]
Public Default Property Item ( _
ByVal header As String _
) As Boolean
[ C# ]
public bool this [
string header
] {get; set;}
[ C++ ]
public: __property bool get_Item (
String* header
);
public: __property void set_Item (
String* header,
bool
);
[ JScript ]
returnValue = HttpCacheVaryByHeadersObject.Item ( header );
HttpCacheVaryByHeadersObject.Item ( header ) = returnValue;
-or-
returnValue = HttpCacheVaryByHeadersObject ( header );
HttpCacheVaryByHeadersObject ( header ) = returnValue;
In [ JScript ], you can use the default indexed properties defined by a type, but you cannot explicitly define your own. However, specifying the expando attribute on a class automatically provides a default indexed property whose type is Object and whose index type is String.
- header
- The name of the custom header.
- header
- The name of the custom header.
The default value is false. When set to true, this property causes ASP.NET to add the specified custom field to the Vary HTTP header sent to the client.
Exception Type |
Condition |
ArgumentNullException |
Occurs when header is a null reference ( Nothing in Visual Basic ). |
The Vary header indicates the request-header fields that the server uses to determine which of multiple cached responses is sent in response to a client request.
For background information on HTTP headers, see Section 14 Header Field Definitions in the Hypertext Transfer Protocol ( HTTP/1.1 ) documentation, available from the World Wide Web Consortium.
HttpCacheVaryByHeaders Members Caching Multiple Versions of a Page