LiteAPI.Cache
1.1.0
See the version list below for details.
dotnet add package LiteAPI.Cache --version 1.1.0
NuGet\Install-Package LiteAPI.Cache -Version 1.1.0
<PackageReference Include="LiteAPI.Cache" Version="1.1.0" />
<PackageVersion Include="LiteAPI.Cache" Version="1.1.0" />
<PackageReference Include="LiteAPI.Cache" />
paket add LiteAPI.Cache --version 1.1.0
#r "nuget: LiteAPI.Cache, 1.1.0"
#:package LiteAPI.Cache@1.1.0
#addin nuget:?package=LiteAPI.Cache&version=1.1.0
#tool nuget:?package=LiteAPI.Cache&version=1.1.0
LiteAPI.Cache — JustCache
GC‑light, cross‑platform in‑memory cache for .NET with a native Rust engine.
JustCache provides low‑latency, predictable caching by leveraging a native Rust store with .NET interop (P/Invoke). It supports strings, byte arrays, JSON objects, per‑key TTL, snapshot/restore, and clean shutdown.
🚀 Key Features
- GC‑light interop: managed allocations minimized; value buffers owned by Rust and copied safely.
- Native performance: Rust store with thread‑safe access.
- Cross‑platform: Windows, Linux, macOS (build native lib for your OS).
- Data types: string, bytes, JSON‑serializable objects.
- TTL/expiry: per‑key TTL with lazy expiration and manual pruning.
- Snapshot/restore: export cache to JSON and restore later.
- Clean shutdown: explicit shutdown and automatic unload hooks.
- Capacity guards: optional max entries/bytes plus default TTL for runaway protection.
Interop: P/Invoke with UTF‑8 marshaling. NativeAOT compatibility can be added later.
📦 Installation
Install the NuGet package:
dotnet add package LiteAPI.Cache
Native library is required at runtime. The provided build scripts drop artifacts into LiteAPI.Cache/runtimes/<rid>/native/ so the NuGet package carries the correct payload for each platform.
Supported RIDs (current binaries)
| RID | Target triple | Artifact |
|---|---|---|
| win-x64 | x86_64-pc-windows-msvc | rust_cache.dll |
Quick Start
using LiteAPI.Cache;
// Optional: simple limits and default TTL
JustCache.Initialize(new JustCacheOptions
{
MaxEntries = 1_000_000,
MaxBytes = 512L * 1024 * 1024, // 512 MB
DefaultTtl = TimeSpan.FromMinutes(5)
});
// Set / Get
JustCache.SetString("k", "hello");
var s = JustCache.GetString("k");
// With TTL
JustCache.SetString("k-ttl", "temp", TimeSpan.FromSeconds(10));
// Snapshot / Restore
var snap = JustCache.ExportJson();
JustCache.ClearAll();
JustCache.ImportJson(snap);
// Shutdown (also runs on process exit)
JustCache.Shutdown();
License & Links
- License: MIT © 2025
- Repo: https://github.com/Nodirbek-Abdulaxadov/LiteAPI.Cache
| Product | Versions 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 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 is compatible. 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 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
- No dependencies.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
new features and performance improvements