MemoryCacheEntryOptions Class

Namespace
Microsoft.Extensions.Caching.Memory
Assemblies
  • Microsoft.Extensions.Caching.Abstractions

Syntax

public class MemoryCacheEntryOptions
class Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions

Properties

Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions.AbsoluteExpiration

Gets or sets an absolute expiration date for the cache entry.

Return type:System.Nullable<System.DateTimeOffset>
public DateTimeOffset? AbsoluteExpiration { get; set; }
Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions.AbsoluteExpirationRelativeToNow

Gets or sets an absolute expiration time, relative to now.

Return type:System.Nullable<System.TimeSpan>
public TimeSpan? AbsoluteExpirationRelativeToNow { get; set; }
Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions.ExpirationTokens

Gets the Microsoft.Extensions.Primitives.IChangeToken instances which cause the cache entry to expire.

Return type:System.Collections.Generic.IList<Microsoft.Extensions.Primitives.IChangeToken>
public IList<IChangeToken> ExpirationTokens { get; }
Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions.PostEvictionCallbacks

Gets or sets the callbacks will be fired after the cache entry is evicted from the cache.

Return type:System.Collections.Generic.IList<Microsoft.Extensions.Caching.Memory.PostEvictionCallbackRegistration>
public IList<PostEvictionCallbackRegistration> PostEvictionCallbacks { get; }
Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions.Priority

Gets or sets the priority for keeping the cache entry in the cache during a memory pressure triggered cleanup. The default is Microsoft.Extensions.Caching.Memory.CacheItemPriority.Normal.

Return type:Microsoft.Extensions.Caching.Memory.CacheItemPriority
public CacheItemPriority Priority { get; set; }
Microsoft.Extensions.Caching.Memory.MemoryCacheEntryOptions.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).

Return type:System.Nullable<System.TimeSpan>
public TimeSpan? SlidingExpiration { get; set; }