LiteAPI.Cache 1.1.0

There is a newer version of this package available.
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
                    
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="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LiteAPI.Cache" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="LiteAPI.Cache" />
                    
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 LiteAPI.Cache --version 1.1.0
                    
#r "nuget: LiteAPI.Cache, 1.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@1.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=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=LiteAPI.Cache&version=1.1.0
                    
Install as a Cake Tool

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();
Product 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.

Version Downloads Last Updated
2.1.0 92 1/20/2026
2.0.0 93 1/20/2026
1.2.2 91 1/19/2026
1.1.2 409 11/19/2025
1.1.1 410 11/19/2025
1.1.0 553 11/18/2025
1.0.1 287 8/7/2025
1.0.0 267 8/7/2025

new features and performance improvements