MultiCache.StackExchangeRedis 2.0.0

dotnet add package MultiCache.StackExchangeRedis --version 2.0.0                
NuGet\Install-Package MultiCache.StackExchangeRedis -Version 2.0.0                
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="MultiCache.StackExchangeRedis" Version="2.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MultiCache.StackExchangeRedis --version 2.0.0                
#r "nuget: MultiCache.StackExchangeRedis, 2.0.0"                
#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.
// 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

CI

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 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. 
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
2.0.0 519 6/10/2023
1.0.2 735 8/21/2021
1.0.0 653 8/1/2021
0.0.1 681 8/1/2021