asp.net.ph

HttpCachePolicy.SetVaryByCustom Method

System.Web Namespace   HttpCachePolicy Class


Sets the Vary HTTP header to the specified text string.

[ VB ]
Public Sub SetVaryByCustom ( _
   ByVal custom As String _
)

[ C# ]
public void SetVaryByCustom (
   string custom
);

[ C++ ]
public: void SetVaryByCustom (
   String* custom
);

[ JScript ]
public function SetVaryByCustom (
   custom : String
);

Parameters

custom
The text to set the Vary header to.

Exceptions


Exception Type Condition
ArgumentNullException Occurs when custom is a null reference ( Nothing in Visual Basic ).
InvalidOperationException Occurs when SetVaryByCustom has already been set.

Example

The following example sets the Vary header to the string "Accept-Charset" to notify the origin-server's cache to choose one of several cached responses depending on the browser's Accept-Charset header.

[ VB ]
Response.Cache.SetVaryByCustom ( "Accept-Charset" )

[ C# ]
Response.Cache.SetVaryByCustom ( "Accept-Charset" );

[ JScript ] 
Response.Cache.SetVaryByCustom ( "Accept-Charset" )
See Also

HttpCachePolicy 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