<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="11.0.0-preview.2.26159.112" />

Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions

Provides the cache options for an entry in IDistributedCache.
public DateTimeOffset? AbsoluteExpiration { get; set; }

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

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

public TimeSpan? SlidingExpiration { get; set; }

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).