.NET library which provides key value cache functionality.
- In memory cache (
InMemoryCache
) - Cloudflare KV storage (
CloudflareCache
) - Redis (
RedisCache
)
- Support for multiple providers (and you can write your own).
- Cache stampede protection (if you use the
ReadOrWrite
method).
builder.Services.AddSingleton<ICache>(new Provider());
where Provider
is one of the supported providers.
ICache cache = new Provider()
When creating the provider, you'll need to pass options. These will extend from options. You can override these values when instantiating your provider.
Requires the package GerwimFeiken.Cache.InMemory
.
Requires the package GerwimFeiken.Cache.Cloudflare
.
See documentation for additional requirements.
Requires the package GerwimFeiken.Cache.Redis
.
See documentation for additional requirements.
Some of the tests might be an integration test. You'll need to specify correct options for these to work.
To pack this library to use on NuGet, run the dotnet pack
command:
dotnet pack -c release