OutputCacheSection.SendCacheControlHeader 属性

定义

获取或设置一个值,该值指示默认情况下 cache-control:private 标头是否由输出缓存模块发送。Gets or sets a value indicating whether the cache-control:private header is sent by the output cache module by default.

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

属性值

如果启用 true 标头的发送,则为 cache-control:private;否则为 falsetrue if the sending of cache-control:private header is enabled; otherwise, false. 默认值为 trueThe default is true.

属性

示例

下面的代码示例说明如何使用 SendCacheControlHeader 属性。The following code example shows how to use the SendCacheControlHeader property.


// 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于未指定输出缓存的内容。The SendCacheControlHeader applies to content with no output caching specified. 如果将其设置为false cache-control:private , 则默认情况下不发送标头。When it is set to false, the cache-control:private header is not sent by default.

备注

默认情况下, 此设置允许在客户端上缓存内容。This setting enables the content to be cached on the client by default.

适用于

另请参阅