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

Microsoft.Extensions.Caching.Distributed.IBufferDistributedCache

Represents a distributed cache of serialized values, with support for low allocation data transfer.
void Set(string key, ReadOnlySequence<byte> value, DistributedCacheEntryOptions options)

Sets or overwrites a cache item.

ValueTask SetAsync(string key, ReadOnlySequence<byte> value, DistributedCacheEntryOptions options, CancellationToken token = default)

Asynchronously sets or overwrites a cache entry.

bool TryGet(string key, IBufferWriter<byte> destination)

Attempts to retrieve an existing cache item.

ValueTask<bool> TryGetAsync(string key, IBufferWriter<byte> destination, CancellationToken token = default)

Asynchronously attempts to retrieve an existing cache entry.