Anexia.Caching.GlobalCache
0.3.2
See the version list below for details.
dotnet add package Anexia.Caching.GlobalCache --version 0.3.2
NuGet\Install-Package Anexia.Caching.GlobalCache -Version 0.3.2
<PackageReference Include="Anexia.Caching.GlobalCache" Version="0.3.2" />
paket add Anexia.Caching.GlobalCache --version 0.3.2
#r "nuget: Anexia.Caching.GlobalCache, 0.3.2"
// Install Anexia.Caching.GlobalCache as a Cake Addin #addin nuget:?package=Anexia.Caching.GlobalCache&version=0.3.2 // Install Anexia.Caching.GlobalCache as a Cake Tool #tool nuget:?package=Anexia.Caching.GlobalCache&version=0.3.2
Anexia Caching
Package with wrapper arround MemoryCache with specified functions to get/set, cache objects.
Installation and configuration
Install the package via NuGet: "Anexia.Caching.GlobalCache"
public class CacheApp : BaseCache<AppModelToCache>
{
//for MemoryCache
public CacheApp()
: base(sizeLimit: null, serializer: UTF8JsonSerializer.Instance)
{}
//for RedisCache
public CacheApp(RedisConfigModel config)
: base(config, typeKey: nameof(AppModelToCache))
{}
}
protected void Application_Start()
{
IBaseCache<AppModelToCache> bsCache = new CacheApp();
bsCache.Insert(
"key as object",
"value as object",
DateTime.UtcNow.AddMinutes(15));
}
Usage
It's a threadsafe implementation for Caching with .Net Standard 2.1. Used in every possible application needed.
Recommended
If you want to use RedisCache, test the Text.Json serializer with your model that you want to cache.
If Text.Json delivers error messages you have to create your own serilizer with the IBaseSerializer.
Testing
If you want to run the Redis cache tests, you have to have a Redis cache running on localhost
List of developers
- Alex Peruzzi <APeruzzi@anexia-it>
- Joachim Eckerl JEckerl@anexia-it.com
- Andreas Aigner AAigner@anexia-it.com
Code Coverage
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[0.2.1] - 2020-07-15
Added
- GetAllKeys() feature to get all the Keys from Cache object
- GetAllValues() feature to get all the Values from Cache object
- HasKey(key, out result) which checks if key is in the Cache with valid expariation date
Changed
- Fixed serialization bug which made string keys from getAllKeys not valid for cache.
[0.2.2] - 2021-02-10
Added
- Redis cache implemented trough, constructor customizable
- GetAllKeys() feature to get all the Keys from Cache object, works with Redis too
- GetAllValues() feature to get all the Values from Cache object, does not work with Redis cache
- HasKey(key, out result) which checks if key is in the Cache with valid expariation date, works with Redis too without out parameter
Changed
- Fixed serialization bug which made string keys from getAllKeys not valid for cache.
Known Issues
- GetAllKeys() works with Redis only if the port number is set in the configuration, gets all the keys from Redis cache not only which is meant for that region
- HasKey() finds all the keys located in the Cache not just for that region
[0.2.5] - 2021-05-26
Added
- Memory and Redis cache now accept sliding expiration during Insert
- Sliding expiration's default is half of the absolute expiration
- Remove method to delete cache key entry
- RemoveAsync to delete cache key entry async
Changed
- GetAllKeys() now returns keys without type key for Redis Cache
[0.2.6] - 2021-09-30
Added
- HasKeyAsync() for universal and redis cache
- HasKey() without item return for universal and redis cache
Changed
- Asynchronous expiration update after getting an item from redis cache
[0.2.7] - 2021-11-22
Breaking Changed
- ACIM.Sales-Namespaces renamed to Anexia.Caching-Namespaces
[0.2.8] - 2022-02-14
Fix
- Fixed issue, where getting all keys from a redis cache database doesn't work when having connection options defined in the redis' connection string
[0.2.9] - 2022-05-04
Added
- GetAllValues for Redis Cache implemented, use with caution
Fixed
- Asynchronous call in InsertAsync was not awaited
[0.2.10] - 2022-05-05
Fixed
- Connection error for GetAllKeys and GetAllValues
[0.2.11] - 2022-05-09
Fixed
- Task null exception when cache is empty - GetAllValues
[0.2.12] - 2022-05-12
Added
- AcquireLock and ReleaseLock for redis cache; Not implemented for in memory cache, since it is not a distributed cache and already thread safe
[0.3.0] - 2023-07-12
Added
- CI-NuGet-Deployment
- Extended Unit-Tests
Product | Versions 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 was computed. 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. |
.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. |
-
.NETStandard 2.1
- Humanizer (>= 2.8.26)
- Microsoft.Extensions.Caching.Memory (>= 5.0.0)
- Microsoft.Extensions.Caching.StackExchangeRedis (>= 5.0.1)
- Microsoft.Extensions.Configuration (>= 5.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 5.0.0)
- Microsoft.Extensions.Configuration.Json (>= 5.0.0)
- Newtonsoft.Json (>= 13.0.1)
- Newtonsoft.Json.Bson (>= 1.0.2)
- StackExchange.Redis (>= 2.5.61)
- System.Text.Json (>= 5.0.1)
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 |
---|---|---|
0.3.4 | 2,454 | 7/20/2023 |
0.3.3 | 155 | 7/20/2023 |
0.3.2 | 156 | 7/20/2023 |
0.3.1 | 168 | 7/14/2023 |
0.3.0 | 164 | 7/14/2023 |
0.2.12 | 13,290 | 5/13/2022 |
0.2.11 | 794 | 5/9/2022 |
0.2.10 | 439 | 5/5/2022 |
0.2.9 | 426 | 5/5/2022 |
0.2.8 | 3,488 | 2/15/2022 |
0.2.7 | 472 | 11/22/2021 |
0.2.6 | 1,716 | 9/30/2021 |
0.2.5 | 1,008 | 6/18/2021 |
0.2.4 | 2,290 | 2/18/2021 |
0.2.3 | 431 | 2/17/2021 |
0.2.2 | 645 | 2/4/2021 |
0.2.1 | 475 | 1/13/2021 |
0.1.0 | 1,857 | 5/12/2020 |