CacheItemPolicy.SlidingExpiration 屬性

定義

取得或設定值,指出是否應該清除已經有一段時間沒有存取過的快取項目。Gets or sets a value that indicates whether a cache entry should be evicted if it has not been accessed in a given span of time.

public:
 property TimeSpan SlidingExpiration { TimeSpan get(); void set(TimeSpan value); };
public TimeSpan SlidingExpiration { get; set; }
member this.SlidingExpiration : TimeSpan with get, set
Public Property SlidingExpiration As TimeSpan

屬性值

TimeSpan

一段時間範圍,必須在此期間內存取快取項目,否則會清除該項目。A span of time within which a cache entry must be accessed before the cache entry is evicted from the cache. 預設值為 NoSlidingExpiration,表示不應根據時間範圍讓項目過期。The default is NoSlidingExpiration, meaning that the item should not be expired based on a time span.

適用於