MultiCache.StackExchangeRedis
2.0.0
dotnet add package MultiCache.StackExchangeRedis --version 2.0.0
NuGet\Install-Package MultiCache.StackExchangeRedis -Version 2.0.0
<PackageReference Include="MultiCache.StackExchangeRedis" Version="2.0.0" />
paket add MultiCache.StackExchangeRedis --version 2.0.0
#r "nuget: MultiCache.StackExchangeRedis, 2.0.0"
// Install MultiCache.StackExchangeRedis as a Cake Addin #addin nuget:?package=MultiCache.StackExchangeRedis&version=2.0.0 // Install MultiCache.StackExchangeRedis as a Cake Tool #tool nuget:?package=MultiCache.StackExchangeRedis&version=2.0.0
MultiCache
What is MultiCache?
MultiCache is a simple library designed to solve complex caching problems. In high-traffic applications, caching mechanisms are often distributed, which can introduce issues due to the use of TCP sockets for each cache request. MultiCache addresses this problem by caching objects both in the Cache Server (Redis) and in the server's memory. This allows subsequent requests to be served directly from memory, improving performance and reducing reliance on the Cache Server.
Getting Started
To start using MultiCache, first configure it to specify the cache server in the startup of your application:
services.AddRedisMultiCacheServices(options =>
{
options.Configuration = "YOUR_REDIS_CONNECTION_STRING";
options.InstanceName = "YOUR_REDIS_INSTANCE_NAME";
});
Then, in your application code, you can use the IMultiCacheManager
interface, which provides the following methods:
Task<(T, bool)> GetAsync<T>(string key, CancellationToken cancellationToken = default);
Task SetAsync<T>(string key, T value, TimeSpan? expiry = null, CancellationToken token = default);
Task<(T, bool)> GetOrCreateAsync<T>(string key, Func<Task<T>> factory, TimeSpan? expiry = null, CancellationToken cancellationToken = default);
Task RemoveAsync(string key, CancellationToken cancellationToken);
Installation
You can install the MultiCache.StackExchangeRedis package via NuGet Package Manager:
PM> Install-Package MultiCache.StackExchangeRedis
Contributing
Contributions to MultiCache are welcome! If you encounter any issues or have suggestions for improvements, please feel free to create an issue or submit a pull request on the GitHub repository. We appreciate your contributions to make MultiCache even better.
License
MultiCache is released under the MIT License. Feel free to use, modify, and distribute it as per the terms of the license.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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 is compatible. 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. |
-
net6.0
- Microsoft.Extensions.Hosting.Abstractions (>= 7.0.0)
- MultiCache (>= 2.0.0)
- StackExchange.Redis.Extensions.AspNetCore (>= 9.1.0)
-
net7.0
- Microsoft.Extensions.Hosting.Abstractions (>= 7.0.0)
- MultiCache (>= 2.0.0)
- StackExchange.Redis.Extensions.AspNetCore (>= 9.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.