OutputCacheSection.EnableOutputCache Property

Definition

Gets or sets a value indicating whether the output cache is enabled.

C#
[System.Configuration.ConfigurationProperty("enableOutputCache", DefaultValue=true)]
public bool EnableOutputCache { get; set; }

Property Value

true if the output cache is enabled; otherwise, false. The default is true.

Attributes

Examples

The following code example shows how to use the EnableOutputCache property.

C#

// Get the current EnabledOutputCache.
Boolean enabledOutputCache = 
    outputCacheSection.EnableOutputCache;

// Set the EnabledOutputCache.
outputCacheSection.EnableOutputCache = false;

Remarks

If the EnableFragmentCache property is set to false, no page is cached on the server, regardless of the settings in @ OutputCache directive or caching profile used by the page. For more information, see OutputCacheSettingsSection and OutputCacheProfile.

Applies to

Производ Верзије
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also