<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="11.0.0-rc.1.26425.128" />

Microsoft.Extensions.Caching.Distributed.IDistributedCache

public interface IDistributedCache
Represents a distributed cache of serialized values.
byte[] Get(string key)

Gets a value with the given key.

Task<byte[]> GetAsync(string key, CancellationToken token = default)

Gets a value with the given key.

void Refresh(string key)

Refreshes a value in the cache based on its key, resetting its sliding expiration timeout (if any).

Task RefreshAsync(string key, CancellationToken token = default)

Refreshes a value in the cache based on its key, resetting its sliding expiration timeout (if any).

void Remove(string key)

Removes the value with the given key.

Task RemoveAsync(string key, CancellationToken token = default)

Removes the value with the given key.

void Set(string key, byte[] value, DistributedCacheEntryOptions options)

Sets a value with the given key.

Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default)

Sets the value with the given key.