<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="10.0.12" />

Microsoft.Extensions.Caching.Memory.IMemoryCache

public interface IMemoryCache : IDisposable
Represents a local in-memory cache whose values are not serialized.

Create or overwrite an entry in the cache.

void Remove(object key)

Removes the object associated with the given key.

bool TryGetValue(object key, out object value)

Gets the item associated with this key if present.