pomelofoundation / caching-mysql Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
using Pomelo.Extensions.Caching.MySql version 2.1.3
DI:
services.AddDistributedMySqlCache(opts =>
{
opts.ConnectionString = config.GetConnectionString("DistributedCache");
opts.SchemaName = "DistributedCache";
opts.TableName = "ApiCache";
opts.DefaultSlidingExpiration = TimeSpan.FromMinutes(10);
});
Usage:
_cache.Set( "my_key", Encoding.UTF8.GetBytes("my_value") );
Error:
System.InvalidOperationException: Either absolute or sliding expiration needs to be provided.
at Pomelo.Extensions.Caching.MySql.DatabaseOperations.ValidateOptions(Nullable`1 slidingExpiration, Nullable`1 absoluteExpiration)
at Pomelo.Extensions.Caching.MySql.DatabaseOperations.SetCacheItem(String key, Byte[] value, DistributedCacheEntryOptions options)
at Pomelo.Extensions.Caching.MySql.MySqlCache.Set(String key, Byte[] value, DistributedCacheEntryOptions options)
at Microsoft.Extensions.Caching.Distributed.DistributedCacheExtensions.Set(IDistributedCache cache, String key, Byte[] value)
Expectation: If DistributedCacheEntryOptions.SlidingExpiration
is not specified, the Set
should use the DefaultSlidingExpiration
as set in the AddDistributedMySqlCache
options.
Use the latest MySqlConnector 1.2.0 package
Can we please have Pomelo.Extensions.Caching.MySql.dll strong named?
This will fix the warning I am receiving when compiling a strong named project, referencing this package:
Warning CS8002 Referenced assembly 'Pomelo.Extensions.Caching.MySql, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null' does not have a strong name.
It would be nice to have instructions in the readme file on how to use set up MySQL as the distributed cache backing store. Also, instructions on how use the config tools to create the necessary database table.
Is it possible to support multiple TargetFrameworks?
It would be great if Pomelo.Extensions.Caching.MySql targeted .NET Standard 2.0 as well.
We are currently using Pomelo.Extensions.Caching.MySql version 2.0.3 with .NET Framework 4.8, and we need the latest version of MySqlConnector, but unfortunately we cannot just update it due to their breaking changes in version 1.0.0,
and we cannot update Pomelo.Extensions.Caching.MySql because now it targets .net standard 2.1
Given the dotnet core 3.1 is the new Long term supported framework (LTS) consider changing to netcoreapp3.1 and netstandard2.1 respectively for *.csproj
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.