HttpResponseBase.SuppressDefaultCacheControlHeader Property

Definition

Gets or sets a value indicating whether to suppress the default Cache Control: private header for the current HTTP response.

public:
 virtual property bool SuppressDefaultCacheControlHeader { bool get(); void set(bool value); };
public virtual bool SuppressDefaultCacheControlHeader { get; set; }
member this.SuppressDefaultCacheControlHeader : bool with get, set
Public Overridable Property SuppressDefaultCacheControlHeader As Boolean

Property Value

Returns Boolean.

Remarks

By default, ASP.NET sends a Cache-Control: private response header unless an explicit cache policy has been specified for this response. This property allows suppressing this default response header on a per-request basis. The header can still be suppressed for the entire application by setting SendCacheControlHeader in httpRuntime Element (ASP.NET Settings Schema) or outputCache Element for caching (ASP.NET Settings Schema).

Use caution when suppressing the default Cache-Control: private header, as proxies and other intermediaries may treat responses without this header as cacheable by default. This treatment can lead to the inadvertent caching of sensitive information. See RFC 2616, Sec. 13.4 for more information.

Applies to