OutputCacheSection.EnableOutputCache Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value indicating whether the output cache is enabled.
public:
property bool EnableOutputCache { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("enableOutputCache", DefaultValue=true)]
public bool EnableOutputCache { get; set; }
[<System.Configuration.ConfigurationProperty("enableOutputCache", DefaultValue=true)>]
member this.EnableOutputCache : bool with get, set
Public Property EnableOutputCache As Boolean
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.
// Get the current EnabledOutputCache.
Boolean enabledOutputCache =
outputCacheSection.EnableOutputCache;
// Set the EnabledOutputCache.
outputCacheSection.EnableOutputCache = false;
' Get the current EnabledOutputCache.
Dim enabledOutputCache As [Boolean] = _
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
See also
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈