Edit

Share via


HttpCachePolicyWrapper.SetCacheability Method

Definition

Sets the Cache-Control header to one of the HttpCacheability values.

Overloads

SetCacheability(HttpCacheability)

Sets the Cache-Control header to the specified HttpCacheability value.

SetCacheability(HttpCacheability, String)

Sets the Cache-Control header to the specified HttpCacheability value and appends an extension to the directive.

SetCacheability(HttpCacheability)

Sets the Cache-Control header to the specified HttpCacheability value.

public:
 override void SetCacheability(System::Web::HttpCacheability cacheability);
public override void SetCacheability (System.Web.HttpCacheability cacheability);
override this.SetCacheability : System.Web.HttpCacheability -> unit
Public Overrides Sub SetCacheability (cacheability As HttpCacheability)

Parameters

cacheability
HttpCacheability

The HttpCacheability enumeration value to set the header to.

Exceptions

cacheability is not one of the enumeration values.

Applies to

SetCacheability(HttpCacheability, String)

Sets the Cache-Control header to the specified HttpCacheability value and appends an extension to the directive.

public:
 override void SetCacheability(System::Web::HttpCacheability cacheability, System::String ^ field);
public override void SetCacheability (System.Web.HttpCacheability cacheability, string field);
override this.SetCacheability : System.Web.HttpCacheability * string -> unit
Public Overrides Sub SetCacheability (cacheability As HttpCacheability, field As String)

Parameters

cacheability
HttpCacheability

The HttpCacheability enumeration value to set the header to.

field
String

The cache-control extension to add to the header.

Exceptions

field is null.

cacheability is not Private or NoCache.

Applies to