This documentation is archived and is not being maintained.

HttpCachePolicy.SetRevalidation Method

Sets the Cache-Control HTTP header to either the must-revalidate or the proxy-revalidate directives based on the supplied enumeration value.

[Visual Basic]
Public Sub SetRevalidation( _
   ByVal revalidation As HttpCacheRevalidation _
)
[C#]
public void SetRevalidation(
 HttpCacheRevalidation revalidation
);
[C++]
public: void SetRevalidation(
 HttpCacheRevalidation revalidation
);
[JScript]
public function SetRevalidation(
   revalidation : HttpCacheRevalidation
);

Parameters

revalidation
The HttpCacheRevalidation enumeration value to set the Cache-Control header to.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException revalidation is not one of the enumeration values.

Remarks

The default is to send neither directive in a header unless explicitly specified by this method.

Example

The following example sets cache revalidation to on (true).

[Visual Basic] 
Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches)
    

[C#] 
Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
    

[C++] 
Response->Cache->SetRevalidation(HttpCacheRevalidation::AllCaches);
    

[JScript] 
Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches)
    

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HttpCachePolicy Class | HttpCachePolicy Members | System.Web Namespace

Show: