편집

다음을 통해 공유


HttpCachePolicy.SetRevalidation(HttpCacheRevalidation) Method

Definition

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

public:
 void SetRevalidation(System::Web::HttpCacheRevalidation revalidation);
public void SetRevalidation (System.Web.HttpCacheRevalidation revalidation);
member this.SetRevalidation : System.Web.HttpCacheRevalidation -> unit
Public Sub SetRevalidation (revalidation As HttpCacheRevalidation)

Parameters

revalidation
HttpCacheRevalidation

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

Exceptions

revalidation is not one of the enumeration values.

Examples

The following code example demonstrates how to set cache revalidation to AllCaches.

Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches)

Remarks

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

SetRevalidation is introduced in the .NET Framework version 3.5. For more information, see Versions and Dependencies.

Applies to

See also