asp.net.ph

HttpCacheVaryByHeaders UserAgent Property

System.Web Namespace   HttpCacheVaryByHeaders Class


Sets or retrieves a value indicating whether the origin server adds the User-Agent header to the Vary HTTP header.

[ VB ]
Public Property UserAgent As Boolean

[ C# ]
public bool UserAgent {get; set;}

[ C++ ]
public: __property bool get_UserAgent ( );
public: __property void set_UserAgent ( bool );

[ JScript ]
public function get UserAgent ( ) : Boolean;
public function set UserAgent ( Boolean );

Property Value

The default value is false. When set to true, this property adds the User-Agent field to the Vary HTTP header sent to the client.

Remarks

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 User-Agent field specifies that the server selects the response based on the client's user-agent type.

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.

Example

This example performs some action only if the UserAgent property is true.

if ( Response.Cache.VaryByHeaders.UserAgent == True ) {
   // ... do whatever here
}
  C# VB

See Also

HttpCacheVaryByHeaders Members   Caching Multiple Versions of a Page Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph