System.Web Namespace HttpCacheVaryByHeaders Class
Sets or retrieves a value indicating whether the origin server adds the Accept field to the Vary HTTP header.
[ VB ]
Public Property AcceptTypes As Boolean
[ C# ]
public bool AcceptTypes {get; set;}
[ C++ ]
public: __property bool get_AcceptTypes ( );
public: __property void set_AcceptTypes ( bool );
[ JScript ]
public function get AcceptTypes ( ) : Boolean;
public function set AcceptTypes ( Boolean );
The default value is false. When set to true, this property causes ASP.NET to add the Accept field to the Vary HTTP header sent to the client.
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. The Accept field specifies that the server selects the response based on the media types acceptable to the client.
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.
This example performs some action only if the AcceptTypes property is true.
if ( Response.Cache.VaryByHeaders.AcceptTypes == True ) {
// ... do whatever here
}
If Response.Cache.VaryByHeaders.AcceptTypes = True Then
' ... do whatever here
End If |
|
C# |
VB |
HttpCacheVaryByHeaders Members Caching Multiple Versions of a Page