Jakar.Json.Caching
10.2.0
dotnet add package Jakar.Json.Caching --version 10.2.0
NuGet\Install-Package Jakar.Json.Caching -Version 10.2.0
<PackageReference Include="Jakar.Json.Caching" Version="10.2.0" />
<PackageVersion Include="Jakar.Json.Caching" Version="10.2.0" />
<PackageReference Include="Jakar.Json.Caching" />
paket add Jakar.Json.Caching --version 10.2.0
#r "nuget: Jakar.Json.Caching, 10.2.0"
#:package Jakar.Json.Caching@10.2.0
#addin nuget:?package=Jakar.Json.Caching&version=10.2.0
#tool nuget:?package=Jakar.Json.Caching&version=10.2.0
Jakar.Json.Caching
Jakar.Json for Microsoft's caches.
HybridCache
builder.Services.AddHybridCache().AddJakarJsonSerializer();
HybridCache asks for a serializer type by type. The factory provides one for every [JsonModel] type, and for arrays, lists and collection interfaces of them. It declines every other type, which HybridCache's default serializer (System.Text.Json) keeps, so you can adopt Jakar.Json one model at a time.
The serializer writes straight into HybridCache's buffer and reads its multi-segment payloads directly: no intermediate byte[] or string either way.
IDistributedCache
await cache.SetJakarJsonAsync("order:7", order, new DistributedCacheEntryOptions { SlidingExpiration = TimeSpan.FromMinutes(5) });
Order? order = await cache.GetJakarJsonAsync<Order>("order:7");
- A missing key returns
default. - Values are stored as Jakar.Json UTF-8.
- When the cache implements
IBufferDistributedCache(Redis, SQL Server and others in .NET 9+), values go through pooled buffers. Otherwise the helpers fall back to thebyte[]API. - Types Jakar.Json can't serialize throw
NotSupportedException, and corrupt values throwJsonReadException.
For FusionCache, see Jakar.Json.FusionCache.
| 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. |
-
net10.0
- Jakar.Json (>= 10.2.0)
- Microsoft.Extensions.Caching.Hybrid (>= 10.11.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
10.2.0: built against Jakar.Json 10.2.0, whose writers take a ref TWriter; 10.1.0 calls the removed IBufferWriter overloads and throws MissingMethodException with Jakar.Json 10.2.0. 10.1.0: initial release.