Rask.Cache
0.19.0
See the version list below for details.
dotnet add package Rask.Cache --version 0.19.0
NuGet\Install-Package Rask.Cache -Version 0.19.0
<PackageReference Include="Rask.Cache" Version="0.19.0" />
<PackageVersion Include="Rask.Cache" Version="0.19.0" />
<PackageReference Include="Rask.Cache" />
paket add Rask.Cache --version 0.19.0
#r "nuget: Rask.Cache, 0.19.0"
#:package Rask.Cache@0.19.0
#addin nuget:?package=Rask.Cache&version=0.19.0
#tool nuget:?package=Rask.Cache&version=0.19.0
Rask.Cache
A developer-facing cache for a Rask app — stored in the app's own database, with no broker or Redis.
- Implements the standard
IDistributedCache, so it drops straight into ASP.NET session state, output caching, and anything else built on the abstraction. - A typed
ICacheconvenience layer addsGetOrCreateAsync<T>read-through, plusGetAsync<T>/SetAsync<T>/RemoveAsync(JSON under the hood). - Entries carry absolute and sliding expirations; a read renews a sliding entry and an expired entry is
evicted lazily. A background
CachePurgersweeps expired rows on an interval.
Use
// Program.cs
builder.Services.AddRaskCache<AppDbContext>();
// AppDbContext.OnModelCreating: modelBuilder.AddRaskCache();
// then: rask db add AddCache && rask db update
// read-through: the factory runs once on a miss, then the value is served from the DB.
var rates = await cache.GetOrCreateAsync(
$"rates:{date:yyyyMMdd}",
ct => exchange.FetchRatesAsync(date, ct),
new DistributedCacheEntryOptions { SlidingExpiration = TimeSpan.FromMinutes(10) });
Register your context as an IDbContextFactory<AppDbContext> (Rask Server sessions are long-lived) and run
one purger per app — SQLite is single-writer.
Trim / AOT: the typed
GetOrCreateAsync<T>/GetAsync<T>/SetAsync<T>overloads use reflection-basedSystem.Text.Json. In a trimmed or AOT app, use theJsonTypeInfo<T>overloads with a source-generatedJsonSerializerContext. TheIDistributedCache(byte[]) surface is fully trim-safe.
| 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
- Microsoft.EntityFrameworkCore (>= 10.0.10)
- Microsoft.Extensions.Caching.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.10)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Rask.Cache:
| Package | Downloads |
|---|---|
|
Rask.Dashboard
A built-in operator dashboard for the Rask One Person Framework batteries. Mounts at /_ops and shows the outbox, background jobs, queued mail and cache from the application's own database — queue depth, dead letters, the errors behind them, stored email previews, the recurring-job schedule, SQLite pragmas and backup status. A live log tail is built in, and becomes a searchable history when Rask.Logging is installed. Panels appear only for the batteries the app actually registered. Protected by an authorization policy that fails closed outside Development. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.19.1-alpha.0.62 | 0 | 8/5/2026 |
| 0.19.1-alpha.0.57 | 0 | 8/5/2026 |
| 0.19.1-alpha.0.51 | 0 | 8/5/2026 |
| 0.19.1-alpha.0.43 | 16 | 8/5/2026 |
| 0.19.1-alpha.0.42 | 25 | 8/5/2026 |
| 0.19.1-alpha.0.40 | 24 | 8/5/2026 |
| 0.19.1-alpha.0.38 | 22 | 8/5/2026 |
| 0.19.1-alpha.0.32 | 24 | 8/5/2026 |
| 0.19.1-alpha.0.31 | 30 | 8/4/2026 |
| 0.19.1-alpha.0.30 | 32 | 8/4/2026 |
| 0.19.1-alpha.0.28 | 28 | 8/4/2026 |
| 0.19.1-alpha.0.25 | 27 | 8/4/2026 |
| 0.19.1-alpha.0.24 | 33 | 8/4/2026 |
| 0.19.1-alpha.0.23 | 32 | 8/4/2026 |
| 0.19.1-alpha.0.14 | 40 | 8/3/2026 |
| 0.19.1-alpha.0.13 | 38 | 8/3/2026 |
| 0.19.1-alpha.0.12 | 39 | 8/3/2026 |
| 0.19.1-alpha.0.11 | 39 | 8/3/2026 |
| 0.19.1-alpha.0.6 | 35 | 8/3/2026 |
| 0.19.0 | 103 | 7/20/2026 |