Skip to content
/ cache Public

.NET library which provides key value cache functionality

License

Notifications You must be signed in to change notification settings

gerwim/cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GerwimFeiken.Cache

.NET library which provides key value cache functionality.

Supported providers

  • In memory cache (InMemoryCache)
  • Cloudflare KV storage (CloudflareCache)
  • Redis (RedisCache)

Features

  1. Support for multiple providers (and you can write your own).
  2. Cache stampede protection (if you use the ReadOrWrite method).

How to use

Dependency injection

builder.Services.AddSingleton<ICache>(new Provider());

where Provider is one of the supported providers.

Console application / class library

ICache cache = new Provider()

General configuration

When creating the provider, you'll need to pass options. These will extend from options. You can override these values when instantiating your provider.

InMemoryCache

Requires the package GerwimFeiken.Cache.InMemory.

CloudflareCache

Requires the package GerwimFeiken.Cache.Cloudflare.

See documentation for additional requirements.

RedisCache

Requires the package GerwimFeiken.Cache.Redis.

See documentation for additional requirements.

Development

Tests

Some of the tests might be an integration test. You'll need to specify correct options for these to work.

Pack

To pack this library to use on NuGet, run the dotnet pack command: dotnet pack -c release

About

.NET library which provides key value cache functionality

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages