![]() |
VOOZH | about |
dotnet add package Pomelo.Extensions.Caching.MySql --version 2.2.1
NuGet\Install-Package Pomelo.Extensions.Caching.MySql -Version 2.2.1
<PackageReference Include="Pomelo.Extensions.Caching.MySql" Version="2.2.1" />
<PackageVersion Include="Pomelo.Extensions.Caching.MySql" Version="2.2.1" />Directory.Packages.props
<PackageReference Include="Pomelo.Extensions.Caching.MySql" />Project file
paket add Pomelo.Extensions.Caching.MySql --version 2.2.1
#r "nuget: Pomelo.Extensions.Caching.MySql, 2.2.1"
#:package Pomelo.Extensions.Caching.MySql@2.2.1
#addin nuget:?package=Pomelo.Extensions.Caching.MySql&version=2.2.1Install as a Cake Addin
#tool nuget:?package=Pomelo.Extensions.Caching.MySql&version=2.2.1Install as a Cake Tool
👁 AppVeyor build status
👁 NuGet
Basing on https://learn.microsoft.com/en-us/aspnet/core/performance/caching/distributed and modified accordingly:
The Distributed MySQL Server Cache implementation (AddDistributedMySqlCache) allows the distributed cache to use a MySQL Server database as its backing store. To create a MySQL Server cached item table in a MySQL Server instance, you can use the dotnet-mysql-cache tool. The tool creates a table with the name and schema that you specify.
CLI tool (globally) can be done with
dotnet tool install --global Pomelo.Extensions.Caching.MySqlConfig.Tools
Now, create a table in MySQL Server by running the dotnet mysql-cache create command. Provide the MySQL Server connection string, instance (for example server=192.169.0.1), table name (for example, NewTableName) and optional database (for example, MyDatabaseName):
dotnet mysql-cache create "server=192.169.0.1;user id=userName;password=P4ssword123!;port=3306;database=MyDatabaseName;Allow User Variables=True" "NewTableName" --databaseName "MyDatabaseName"
A message is logged to indicate that the tool was successful:
Table and index were created successfully.
The table created by the dotnet-mysql-cache tool has the following schema:
An app should manipulate cache values using an instance of IDistributedCache, not any other.
The example snippet how to implement MySql Server cache in Program.cs:
builder.Services.AddDistributedMySqlCache(options =>
{
options.ConnectionString = builder.Configuration.GetConnectionString("DistCache_ConnectionString");
options.SchemaName = "MyDatabaseName"; //optional
options.TableName = "NewTableName"; //required
});
A ConnectionString (and optionally, SchemaName and TableName) are typically stored outside of source control (for example, stored by the Secret Manager or in appsettings.json/appsettings.{Environment}.json files). The connection string may contain credentials that should be kept out of source control systems.
One can use same technique as described in this section Use the distributed cache
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Pomelo.Extensions.Caching.MySql:
| Package | Downloads |
|---|---|
|
CyberEye.CommonCaching.Lib
Package chứa các thư viện, hàm tiện ích, class model về Distributed Caching (Memory, Redis cache) |
|
|
SuperiorAcumaticaPackage
Dependencies required to compile the SuperiorAcumaticaSolution for Acumatica 2026 R1 Build 26.100.0175 |
|
|
IdentitySuite.EntityFrameworkCore.MySql
MySql store for IdentitySuite, a ready-to-use OpenId Connect Server based on Openiddict with Microsoft Identity and a comprehensive management shell. |
|
|
Route4MeDbLibrary
The library enables to create/use different engine databases for consuming Route4Me system. Supported database engines: - MsSql (SqlExpress, LocalDb) - MySql - PostgrSql - SQLite The library is done in the c# (.net core) envirnoment and it's platform-independent. |
|
|
Pavalisoft.Caching.MySql
Pavalisoft.Caching.MySql is a MySql Cache store implementation of Pavalisoft.Caching |
Showing the top 1 popular GitHub repositories that depend on Pomelo.Extensions.Caching.MySql:
| Repository | Stars |
|---|---|
|
simpleidserver/SimpleIdServer
OpenID, OAuth 2.0, SCIM2.0, UMA2.0, FAPI, CIBA & OPENBANKING Framework for ASP.NET Core
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.2.1 | 95,779 | 1/6/2025 |
| 2.2.0 | 73,741 | 5/17/2024 |
| 2.1.4 | 68,312 | 6/27/2023 |
| 2.1.3 | 8,560 | 4/17/2023 |
| 2.1.2 | 110,820 | 9/13/2021 |
| 2.1.1 | 5,035 | 4/2/2021 |
| 2.1.0 | 2,546 | 12/6/2020 |
| 2.0.4 | 64,580 | 12/28/2021 |
| 2.0.3 | 38,190 | 4/20/2020 |
| 2.0.2 | 4,755 | 12/2/2019 |
| 2.0.1 | 10,591 | 12/9/2018 |
| 2.0.0-final | 2,340 | 3/13/2018 |
| 1.0.0-preview1-final | 2,337 | 7/25/2017 |