Clustron.Extensions.Caching.Hybrid 0.1.1

dotnet add package Clustron.Extensions.Caching.Hybrid --version 0.1.1
                    
NuGet\Install-Package Clustron.Extensions.Caching.Hybrid -Version 0.1.1
                    
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.Extensions.Caching.Hybrid" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Clustron.Extensions.Caching.Hybrid" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="Clustron.Extensions.Caching.Hybrid" />
                    
Project file
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.Extensions.Caching.Hybrid --version 0.1.1
                    
#r "nuget: Clustron.Extensions.Caching.Hybrid, 0.1.1"
                    
#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.Extensions.Caching.Hybrid@0.1.1
                    
#: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.Extensions.Caching.Hybrid&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=Clustron.Extensions.Caching.Hybrid&version=0.1.1
                    
Install as a Cake Tool

Clustron Hybrid Cache

Clustron Hybrid Cache provides a high-performance implementation of HybridCache using Clustron DKV.

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.Extensions.Caching.Hybrid

โš™๏ธ Usage

1. Create L1 and L2 clients

var l1 = await DKVClient.InitializeInProc("l1");

var l2 = await DKVClient.Initialize(
    "store",
    DkvClientMode.Remote,
    new[]
    {
        new DkvServerInfo("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 DKVClient.InitializeInProc("l1");
var l2 = await DKVClient.InitializeInProc("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

https://github.com/zeroheartbeat/clustron-dkv

Product 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.

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.1.1 121 3/18/2026