Clustron.Zaris.HybridCache
2.0.0
dotnet add package Clustron.Zaris.HybridCache --version 2.0.0
NuGet\Install-Package Clustron.Zaris.HybridCache -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="Clustron.Zaris.HybridCache" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Clustron.Zaris.HybridCache" Version="2.0.0" />
<PackageReference Include="Clustron.Zaris.HybridCache" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Clustron.Zaris.HybridCache --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Clustron.Zaris.HybridCache, 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.
#:package Clustron.Zaris.HybridCache@2.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Clustron.Zaris.HybridCache&version=2.0.0
#tool nuget:?package=Clustron.Zaris.HybridCache&version=2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Clustron Hybrid Cache
Clustron Hybrid Cache provides a high-performance implementation of HybridCache using Clustron Zaris.
It enables:
- L1 (in-memory / in-proc cache)
- L2 (distributed cache)
- Tag-based invalidation
- Stampede protection
- TTL layering
๐ Features
- Built on Microsoft
HybridCache - L1 + L2 architecture
- Tag invalidation (distributed)
- Cache stampede protection
- Works with ASP.NET Core
๐ฆ Installation
dotnet add package Clustron.Zaris.HybridCache
โ๏ธ Usage
1. Create L1 and L2 clients
var l1 = await ZarisClient.ConnectAsync("zaris://inproc/l1");
var l2 = await ZarisClient.Initialize(
"store",
ZarisClientMode.Remote,
new[]
{
new ZarisServerInfo("localhost", 7861)
});
2. Register HybridCache
builder.Services.AddSingleton<HybridCache>(
new ClustronHybridCache(l1, l2));
3. Use HybridCache
app.MapGet("/product/{id}", async (int id, HybridCache cache) =>
{
return await cache.GetOrCreateAsync(
key: $"product:{id}",
state: id,
async (state, ct) =>
{
Console.WriteLine("DB HIT");
await Task.Delay(200, ct);
return new Product
{
Id = state,
Name = $"Product {state}",
Price = 100
};
},
options: new HybridCacheEntryOptions
{
Expiration = TimeSpan.FromMinutes(5),
LocalCacheExpiration = TimeSpan.FromSeconds(30)
});
});
๐งช Local Testing
var l1 = await ZarisClient.ConnectAsync("zaris://inproc/l1");
var l2 = await ZarisClient.ConnectAsync("zaris://inproc/l2");
๐ง How It Works
- L1 is checked first (fast, in-memory)
- On miss โ L2 is checked (distributed)
- On miss โ factory is executed
- Value is stored in both L1 and L2
- Tags are validated using distributed timestamps
๐ License
Business Source License 1.1 (BUSL-1.1)
Production use requires a commercial license.
Contact: support@clustron.io
๐ Repository
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Clustron.Zaris.Client (>= 2.0.0)
- Clustron.Zaris.InProc (>= 2.0.0)
- Microsoft.Extensions.Caching.Hybrid (>= 10.4.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.