VOOZH about

URL: https://www.nuget.org/packages/Tharga.Cache/

⇱ NuGet Gallery | Tharga.Cache 0.4.8




👁 Image
Tharga.Cache 0.4.8

dotnet add package Tharga.Cache --version 0.4.8
 
 
NuGet\Install-Package Tharga.Cache -Version 0.4.8
 
 
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="Tharga.Cache" Version="0.4.8" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Tharga.Cache" Version="0.4.8" />
 
Directory.Packages.props
<PackageReference Include="Tharga.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 Tharga.Cache --version 0.4.8
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Tharga.Cache, 0.4.8"
 
 
#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 Tharga.Cache@0.4.8
 
 
#: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=Tharga.Cache&version=0.4.8
 
Install as a Cake Addin
#tool nuget:?package=Tharga.Cache&version=0.4.8
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Tharga.Cache

👁 NuGet
👁 Nuget

A flexible .NET caching library with multiple cache strategies, configurable eviction policies, and stale-while-revalidate support — all with a clean DI-first API.

Features

  • Four cache strategies — Eternal, Time-To-Live (TTL), Time-To-Idle (TTI), and Scoped
  • Eviction policies — LRU, FIFO, or Random when size or count limits are reached
  • Stale-while-revalidate — return cached data instantly while refreshing in the background
  • Pluggable persistence — in-memory by default, with optional Redis, MongoDB, and file backends
  • Fail-open — when a persist backend is unreachable, reads fall through to the source loader and writes are skipped, so a cache outage never faults the caller (CacheOptions.FailOpenOnBackendError, on by default)
  • Composite keys — build cache keys from multiple parts with KeyBuilder
  • Monitoring — inspect cache state, item counts, and fetch queue depth via ICacheMonitor
  • Background cleanup — built-in WatchDog service removes stale entries automatically

Get Started

dotnet add package Tharga.Cache
// Register
builder.Services.AddCache();

// Use
public class MyService
{
 private readonly ITimeToLiveCache _cache;

 public MyService(ITimeToLiveCache cache) => _cache = cache;

 public Task<Product> GetProductAsync(int id) =>
 _cache.GetAsync<Product>($"product-{id}", () => LoadAsync(id), TimeSpan.FromMinutes(10));
}

Persistence Backends

Extend with optional packages to persist beyond memory:

Package Backend
Tharga.Cache.Redis Redis
Tharga.Cache.MongoDB MongoDB
Tharga.Cache.File Local files

Documentation

Full documentation, configuration options, and samples are available on the GitHub project page.

License

MIT

Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on Tharga.Cache:

Package Downloads
Quilt4Net.Toolkit

Tools for Health checks via Quilt4Net.Toolkit.Api and Application Insigts.

Tharga.Cache.Redis

Redis cache features.

Tharga.Cache.MongoDB

MongoDB cache features.

Tharga.Cache.Blazor

Component for manageing the Tharga Cache features in blazor.

Tharga.Cache.File

File cache features.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.4.8 125 6/15/2026
0.4.7 592 6/11/2026
0.4.6 1,218 5/18/2026
0.4.5 245 5/11/2026
0.4.4 554 5/10/2026
0.4.3 493 5/6/2026
0.4.2 430 4/29/2026
0.4.1 684 4/18/2026
0.4.0 347 4/6/2026
0.3.8 156 4/6/2026
0.3.7 163 4/6/2026
0.3.6 722 3/25/2026
0.3.5 551 2/8/2026
0.3.0 168 2/3/2026
0.2.13 1,269 12/13/2025
0.2.11 260 12/13/2025
0.2.9 442 11/30/2025
0.2.7 407 11/17/2025
0.2.5 372 11/12/2025
0.2.3 351 11/12/2025
Loading failed