Class MemoryCacheEntryOptions<TKey>
Represents the cache options applied to an entry of the IMemoryCache<TKey, TEntry> instance.
public class MemoryCacheEntryOptions<TKey> where TKey : notnull
Type Parameters
TKey
- Inheritance
-
MemoryCacheEntryOptions<TKey>
- Extension Methods
Properties
AbsoluteExpiration
Gets or sets an absolute expiration date for the cache entry.
public DateTimeOffset? AbsoluteExpiration { get; set; }
Property Value
AbsoluteExpirationRelativeToNow
Gets or sets an absolute expiration time, relative to now.
public TimeSpan? AbsoluteExpirationRelativeToNow { get; set; }
Property Value
ExpirationTokens
Gets the IChangeToken instances which cause the cache entry to expire.
public IList<IChangeToken> ExpirationTokens { get; }
Property Value
PostEvictionCallbacks
Gets or sets the callbacks will be fired after the cache entry is evicted from the cache.
public IList<PostEvictionCallbackRegistration<TKey>> PostEvictionCallbacks { get; }
Property Value
Priority
Gets or sets the priority for keeping the cache entry in the cache during a memory pressure triggered cleanup. The default is Normal.
public CacheItemPriority Priority { get; set; }
Property Value
Size
Gets or sets the size of the cache entry value.
public long? Size { get; set; }
Property Value
- long?
SlidingExpiration
Gets or sets how long a cache entry can be inactive (e.g. not accessed) before it will be removed. This will not extend the entry lifetime beyond the absolute expiration (if set).
public TimeSpan? SlidingExpiration { get; set; }