squirix.extensions.caching
0.2.0-preview.1
dotnet add package squirix.extensions.caching --version 0.2.0-preview.1
NuGet\Install-Package squirix.extensions.caching -Version 0.2.0-preview.1
<PackageReference Include="squirix.extensions.caching" Version="0.2.0-preview.1" />
<PackageVersion Include="squirix.extensions.caching" Version="0.2.0-preview.1" />
<PackageReference Include="squirix.extensions.caching" />
paket add squirix.extensions.caching --version 0.2.0-preview.1
#r "nuget: squirix.extensions.caching, 0.2.0-preview.1"
#:package squirix.extensions.caching@0.2.0-preview.1
#addin nuget:?package=squirix.extensions.caching&version=0.2.0-preview.1&prerelease
#tool nuget:?package=squirix.extensions.caching&version=0.2.0-preview.1&prerelease
Squirix distributed cache provider
Use squirix.extensions.caching to store IDistributedCache values on a Squirix server. Use the same preview release of the adapter, client and server.
Early preview. Evaluate it before production use.
using Microsoft.Extensions.DependencyInjection;
builder.Services.AddSquirixCache(options =>
options.ClientOptions.Endpoints.Add(new Uri("https://cache.example.com:7443")));
To use Squirix as the secondary cache for Microsoft HybridCache, register the provider as above and call builder.Services.AddHybridCache() from the separate
Microsoft.Extensions.Caching.Hybrid package. HybridCache manages its local cache in the application. Squirix stores the secondary values on the server.
using Microsoft.Extensions.Caching.Hybrid;
builder.Services.AddHybridCache();
var app = builder.Build();
app.MapGet("/cached-message", async (HybridCache cache, CancellationToken token) =>
await cache.GetOrCreateAsync(
"demo:message",
static _ => ValueTask.FromResult("Hello from HybridCache"),
cancellationToken: token));
app.Run();
Registration replaces other unkeyed IDistributedCache providers. Repeated calls compose configuration in order and keep one singleton.
The provider connects lazily, reuses its client, and is disposed with the service provider.
Configure a bearer token delegate through ClientOptions.BearerTokenProvider when required.
Get returns null for a missing entry. An empty stored value returns an empty array. Set replaces the value and its expiration policy together.
When both absolute options are set, the earlier deadline wins. Get and Refresh renew sliding entries up to any absolute cap. Remove deletes the entry and its policy.
Each network attempt of Get reads the current entry and renews that entry atomically. A retry can return newer bytes or a miss.
Read responses and removed values are not retained as mutation outcomes. Sliding renewals still journal and replicate the updated entry.
Upgrade the adapter, client and all server nodes together. Stop the old nodes and use empty server data directories for this preview format; older directories and replication snapshots are rejected. Keep the old data and binaries together for rollback.
The provider stores the bytes supplied by the caller or HybridCache. Native Squirix serializers and JSON contexts are unused. Avoid sharing the configured cache namespace with a native application that writes its own values.
The asynchronous methods accept caller cancellation. Cancellation can end the wait for a remote mutation after the server has already accepted it. The synchronous methods block until their corresponding operation completes. An asynchronous bearer token provider should honor cancellation. Disposal cancels pending work and waits up to 30 seconds for the owned client to shut down.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. net11.0 is compatible. |
-
net10.0
- Microsoft.Extensions.Caching.Abstractions (>= 11.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 11.0.0)
- Microsoft.Extensions.Options (>= 11.0.0)
- squirix (= 0.2.0-preview.1)
-
net11.0
- squirix (= 0.2.0-preview.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.2.0-preview.1 | 37 | 11/23/2026 |
Squirix 0.2.0-preview.1 uses the native server and updates the client packages. See https://github.com/squirix/squirix/blob/main/docs/release-notes/v0.2.0-preview.1.md