microservice.toolkit.cachemanager 3.0.0-alpha.1

This is a prerelease version of microservice.toolkit.cachemanager.
dotnet add package microservice.toolkit.cachemanager --version 3.0.0-alpha.1
                    
NuGet\Install-Package microservice.toolkit.cachemanager -Version 3.0.0-alpha.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="microservice.toolkit.cachemanager" Version="3.0.0-alpha.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="microservice.toolkit.cachemanager" Version="3.0.0-alpha.1" />
                    
Directory.Packages.props
<PackageReference Include="microservice.toolkit.cachemanager" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add microservice.toolkit.cachemanager --version 3.0.0-alpha.1
                    
#r "nuget: microservice.toolkit.cachemanager, 3.0.0-alpha.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=microservice.toolkit.cachemanager&version=3.0.0-alpha.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=microservice.toolkit.cachemanager&version=3.0.0-alpha.1&prerelease
                    
Install as a Cake Tool

Cache manager

Build Release License: MIT Nuget Nuget

Implementations collections of ICacheManager.

How to install

Package Manager

Install-Package microservice.toolkit.cachemanager -Version 2.1.0

.NET CLI

dotnet add package microservice.toolkit.cachemanager --version 2.1.0

Package Reference

<PackageReference Include="microservice.toolkit.cachemanager" Version="2.1.0" />

Implementations

In memory

<a name="inmemory"></a> Naif version of an in-memory cache implementation.

How to use:

var manager = new InMemoryCacheManager();

SQLite cache manager

<a name="sqlite"></a> To start using SQLite cache manager, first install the required package:

<PackageReference Include="Microsoft.Data.SQLite" Version="5.0.10" />

Create the table cache:

CREATE TABLE cache(
    id TEXT PRIMARY KEY,
    value TEXT NOT NULL,
    issuedAt INTEGER NOT NULL
);

And instantiate the cache manger:

var dbConnection = new SqliteConnection($"[CONNECTION_STRING]");
var manager = new SQLiteCacheManager(dbConnection);

You can specify value serializer, choose between "Newtonsoft JSON", "XML" and "System.Text.Json" (default).\

Newtonsoft JSON
Install Newtonsoft JSON dependency:

dotnet add package Newtonsoft.Json --version 13.0.2

And use the serializer:

var manager = new SQLiteCacheManager(dbConnection, new NewtonsoftJsonCacheValueSerializer());

System.Text.Json

var manager = new SQLiteCacheManager(dbConnection, new JsonCacheValueSerializer());

XML

var manager = new SQLiteCacheManager(dbConnection, new XmlCacheValueSerializer());

MySQL cache manager

<a name="mysql"></a> To start using MySql cache manager, first install the required package:

<PackageReference Include="MySqlConnector" Version="1.3.12" />

Create the table cache:

CREATE TABLE cache(
    id VARCHAR(256) PRIMARY KEY,
    value TEXT NOT NULL,
    issuedAt BIGINT NOT NULL
);

And instantiate the cache manger:

var dbConnection = new MySqlConnection($"[CONNECTION_STRING]");
var manager = new MysqlCacheManager(dbConnection);

You can specify value serializer, choose between "Newtonsoft JSON", "XML" and "System.Text.Json" (default).\

Newtonsoft JSON
Install Newtonsoft JSON dependency:

dotnet add package Newtonsoft.Json --version 13.0.2

And use the serializer:

var manager = new MysqlCacheManager(dbConnection, new NewtonsoftJsonCacheValueSerializer());

System.Text.Json

var manager = new MysqlCacheManager(dbConnection, new JsonCacheValueSerializer());

XML

var manager = new MysqlCacheManager(dbConnection, new XmlCacheValueSerializer());

Memcached

<a name="memcached"></a> To start using Memcached cache manager, first install the required package:

<PackageReference Include="Enyim.Memcached2" Version="0.6.8" />

How to use:

var manager = new MemcachedCacheManager("localhost:11211");

Or, if you are using a cluster:

var manager = new MemcachedCacheManager("localhost:11211,localhost:11212");

Redis

<a name="redis"></a> To start using Redis cache manager, first install the required package:

<PackageReference Include="StackExchange.Redis" Version="2.2.62" />

How to use:

var manager = new RedisCacheManager("localhost:6379");

You can specify value serializer, choose between "Newtonsoft JSON", "XML" and "System.Text.Json" (default).\

Newtonsoft JSON
Install Newtonsoft JSON dependency:

dotnet add package Newtonsoft.Json --version 13.0.2

And use the serializer:

var manager = new RedisCacheManager("localhost:6379", new NewtonsoftJsonCacheValueSerializer());

System.Text.Json

var manager = new RedisCacheManager("localhost:6379", new JsonCacheValueSerializer());

XML

var manager = new RedisCacheManager("localhost:6379", new XmlCacheValueSerializer());
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0-alpha.1 88 7/4/2025
3.0.0-alpha 84 6/28/2025
2.1.0 133 12/15/2024
2.0.1 126 7/30/2024
2.0.0 116 7/28/2024
1.1.1 137 7/19/2024
1.1.0 117 7/19/2024
1.0.0 122 6/10/2024
0.11.2 155 4/6/2024
0.11.1 131 3/30/2024
0.11.0 125 3/30/2024
0.10.2 288 3/15/2023
0.10.1 381 1/18/2023
0.10.0 329 1/11/2023
0.9.1 410 11/22/2022
0.9.0 414 11/16/2022
0.8.0 525 10/12/2022
0.7.0 503 4/28/2022
0.6.2 491 2/28/2022
0.6.1 480 2/21/2022
0.6.0 520 1/15/2022
0.5.0 346 12/8/2021
0.4.9 359 12/2/2021
0.4.8 359 12/2/2021
0.4.7 355 12/2/2021
0.4.6 366 12/1/2021
0.4.5 3,440 11/25/2021
0.4.4 350 11/2/2021
0.4.3 356 11/2/2021
0.4.2 442 10/27/2021
0.4.1 406 10/21/2021
0.4.0 543 10/3/2021