CacheSection.DisableExpiration 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 cache expiration is disabled.
public:
property bool DisableExpiration { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("disableExpiration", DefaultValue=false)]
public bool DisableExpiration { get; set; }
[<System.Configuration.ConfigurationProperty("disableExpiration", DefaultValue=false)>]
member this.DisableExpiration : bool with get, set
Public Property DisableExpiration As Boolean
Property Value
true
if the cache expiration is disabled; otherwise, false
. The default is false
.
- Attributes
Examples
The following code example shows how to use the DisableExpiration property.
// Enable or disable cache expiration.
cacheSection.DisableExpiration =
!cacheSection.DisableExpiration;
' Enable or disable cache expiration.
cacheSection.DisableExpiration =
Not cacheSection.DisableExpiration
Remarks
If the DisableExpiration property is set to true
, the cached items never expire. This setting is intended to help debug cache behavior in application code. Use caution when disabling cache expiration, as this might result in items being cached longer than they are valid.
Note
To add a page to the output cache, you must establish an expiration policy for that page. You can do this declaratively with the @ OutputCache directive or programmatically using the SetExpires method. For more information, see How to: Set Expiration Values for ASP.NET Page Caching.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기