Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

DistributedCacheEntryOptions Class

Definition

Namespace:
Microsoft.Extensions.Caching.Distributed
Assembly:
Microsoft.Extensions.Caching.Abstractions.dll
Package:
Microsoft.Extensions.Caching.Abstractions v11.0.0-preview.5.26302.115
Source:
DistributedCacheEntryOptions.cs
Source:
DistributedCacheEntryOptions.cs
Source:
DistributedCacheEntryOptions.cs
Source:
DistributedCacheEntryOptions.cs

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.

Provides the cache options for an entry in IDistributedCache.

public ref class DistributedCacheEntryOptions
public class DistributedCacheEntryOptions
type DistributedCacheEntryOptions = class
Public Class DistributedCacheEntryOptions
Inheritance
DistributedCacheEntryOptions

Constructors

Name Description
DistributedCacheEntryOptions()

Properties

Name Description
AbsoluteExpiration

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

AbsoluteExpirationRelativeToNow

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

SlidingExpiration

Gets or sets how long a cache entry can be inactive (for example, not accessed) before it will be removed. This will not extend the entry lifetime beyond the absolute expiration (if set).

Methods

Name Description
Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Extension Methods

Name Description
SetAbsoluteExpiration(DistributedCacheEntryOptions, DateTimeOffset)

Sets an absolute expiration date for the cache entry.

SetAbsoluteExpiration(DistributedCacheEntryOptions, TimeSpan)

Sets an absolute expiration time, relative to now.

SetSlidingExpiration(DistributedCacheEntryOptions, TimeSpan)

Sets how long the cache entry can be inactive (for example, not accessed) before it will be removed. This will not extend the entry lifetime beyond the absolute expiration (if set).

Applies to


Feedback

Was this page helpful?