Share via


HttpRuntimeSection.SendCacheControlHeader 属性

定义

获取或设置一个值,该值指示标头是否 cache-control:private 作为 HTTP 响应的一部分发送。

public:
 property bool SendCacheControlHeader { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("sendCacheControlHeader", DefaultValue=true)]
public bool SendCacheControlHeader { get; set; }
[<System.Configuration.ConfigurationProperty("sendCacheControlHeader", DefaultValue=true)>]
member this.SendCacheControlHeader : bool with get, set
Public Property SendCacheControlHeader As Boolean

属性值

true 如果要发送标头, cache-control:private 则为 ;否则为 false。 默认值是 false

属性

注解

HttpResponse 检查 HttpRuntimeSection.SendCacheControlHeader 属性和 OutputCacheSection.SendCacheControlHeader 属性,以确定是否在 HTTP 响应中发送 cache-control:private 标头。 如果任一属性设置为 false,则不会发送标头。 当缓存控制标头设置为 private时,客户端不会在共享缓存中缓存响应。

SendCacheControlHeader为了与旧版应用程序兼容,提供对 类中的 HttpRuntimeSection 属性的支持;此属性在 .NET Framework 2.0 版中已过时。 有关更多信息,请参见 OutputCacheSection 类。

适用于