LiteAPI.Cache
2.1.0
dotnet add package LiteAPI.Cache --version 2.1.0
NuGet\Install-Package LiteAPI.Cache -Version 2.1.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="LiteAPI.Cache" Version="2.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LiteAPI.Cache" Version="2.1.0" />
<PackageReference Include="LiteAPI.Cache" />
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 LiteAPI.Cache --version 2.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: LiteAPI.Cache, 2.1.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 LiteAPI.Cache@2.1.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=LiteAPI.Cache&version=2.1.0
#tool nuget:?package=LiteAPI.Cache&version=2.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
LiteAPI.Cache (JustCache)
Fast, GC-free, cross-platform in-memory cache for .NET backed by Rust.
Install
dotnet add package LiteAPI.Cache
Requires a precompiled native Rust library. Build RustLib or use packaged runtimes.
Quick start
using LiteAPI.Cache;
JustCache.Initialize();
JustCache.SetString("hello", "world");
Console.WriteLine(JustCache.GetString("hello"));
JustCache.SetStringWithTtl("temp", "value", TimeSpan.FromSeconds(1));
Console.WriteLine(JustCache.TtlMs("temp"));
// GC-free hot path (no per-call byte[] allocations):
var keyBytes = System.Text.Encoding.UTF8.GetBytes("hot:key");
var buffer = new byte[32 * 1024];
if (JustCache.TryGet(keyBytes, buffer, out var written))
Console.WriteLine($"bytes={written}");
JustCache.Remove("hello");
JustCache.ClearAll();
Key features
- Native Rust-backed, in-memory cache with a GC-free hot path.
- Cross-platform support (Windows, Linux, macOS) with runtime RID loading.
- Byte[] and string APIs for cache keys and values.
- TTL support with millisecond precision and Redis-style TTL semantics.
- LRU sizing controls and item count metrics.
- Append-only file (AOF) persistence load/enable/disable.
- Redis-like data structures: hashes, lists, sets, sorted sets, and streams.
- Pub/Sub channels and keyspace notifications for expired/evicted keys.
- JSON path get/set for stored JSON values.
- Secondary numeric index and key search via
FindKeys. - Optional JSON serialization helpers for objects and collections.
Usage
- Initialize the native layer once:
JustCache.Initialize(). - Set/get bytes or strings:
Set,Get,SetString,GetString. - TTL operations:
SetWithTtl,SetStringWithTtl,Expire,TtlMs. - LRU sizing:
SetMaxItems,GetMaxItems,Count. - Binary keys:
Set(byte[] key, byte[] value),Get(byte[] key),Remove(byte[] key). - GC-free get (caller buffer):
TryGet(byte[] key, Span<byte> destination, out int written). - Hashes:
HSet,HGet,HGetAll. - Lists:
LPush,RPop,LRange. - Sets:
SAdd,SIsMember. - Sorted sets:
ZAdd,ZRange. - Streams:
XAdd,XRange. - Pub/Sub:
Subscribe,Publish,TryPoll,Unsubscribe. - Notifications:
TryPollNotification,ClearNotifications. - JSON path:
JsonGet,JsonSet. - Search:
CreateNumericIndex,FindKeys. - Scripting:
Eval,EvalString. - Object helpers:
SetObject,GetObject,SetObjects,GetObjects.
Notes
- Native library is required at runtime.
- Full documentation will live in a separate docs project.
License
MIT License © 2025 LiteAPI
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
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.
binary-key fast path + zero-copy lease API for large payload reads