OutputCacheSection.SendCacheControlHeader 属性

定义

获取或设置一个值,该值指示标头是否 cache-control:private 默认由输出缓存模块发送。

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。 默认值为 true

属性

示例

下面的代码示例演示如何使用该 SendCacheControlHeader 属性。


// Get the current SendCacheControlHeader.
Boolean sendCacheControlHeaderValue = 
    outputCacheSection.SendCacheControlHeader;

// Set the SendCacheControlHeader.
outputCacheSection.SendCacheControlHeader = false;
' Get the current SendCacheControlHeader.
  Dim sendCacheControlHeaderValue As [Boolean] = _
  outputCacheSection.SendCacheControlHeader

' Set the SendCacheControlHeader.
outputCacheSection.SendCacheControlHeader = False

注解

适用于 SendCacheControlHeader 未指定输出缓存的内容。 设置为 /> 时, 默认情况下不会发送标头。

注释

此设置允许默认情况下在客户端上缓存内容。

适用于

另请参阅