Export (0) Print
Expand All

HttpResponse.SuppressDefaultCacheControlHeader Property

.NET Framework 4.5

[Supported in the .NET Framework 4.5.2 and later versions]

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

Namespace:  System.Web
Assembly:  System.Web (in System.Web.dll)

public bool SuppressDefaultCacheControlHeader { get; set; }

Property Value

Type: System.Boolean
Returns Boolean.

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.

.NET Framework

Supported in: 4.5.2
© 2014 Microsoft