Rask.Cache
0.20.1-alpha.0.213
See the version list below for details.
dotnet add package Rask.Cache --version 0.20.1-alpha.0.213
NuGet\Install-Package Rask.Cache -Version 0.20.1-alpha.0.213
<PackageReference Include="Rask.Cache" Version="0.20.1-alpha.0.213" />
<PackageVersion Include="Rask.Cache" Version="0.20.1-alpha.0.213" />
<PackageReference Include="Rask.Cache" />
paket add Rask.Cache --version 0.20.1-alpha.0.213
#r "nuget: Rask.Cache, 0.20.1-alpha.0.213"
#:package Rask.Cache@0.20.1-alpha.0.213
#addin nuget:?package=Rask.Cache&version=0.20.1-alpha.0.213&prerelease
#tool nuget:?package=Rask.Cache&version=0.20.1-alpha.0.213&prerelease
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 addsGetOrAddAsync<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.GetOrAddAsync(
$"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.
Already running Redis?
ICache works over any IDistributedCache, so point it at the one you have — no CacheEntry table, no
purge worker, no migration:
builder.Services.AddStackExchangeRedisCache(o => o.Configuration = "localhost:6379");
builder.Services.AddRaskCache(); // no <AppDbContext>
There is deliberately no Rask.Cache.Redis package —
Microsoft.Extensions.Caching.StackExchangeRedis is the standard .NET API for this. The overload takes no
CacheOptions, because both of them are implemented by the database-backed store and would silently do
nothing against another one.
Trim / AOT: the typed
GetOrAddAsync<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.11)
- Microsoft.Extensions.Caching.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
NuGet packages (2)
Showing the top 2 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 /_rask 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. |
|
|
Rask
The one reference a Rask application needs, server or browser. On net10.0 it brings the ASP.NET host plus every battery — database, mediator, background jobs, transactional email, cache, outbox, operator dashboard, durable logs, Web Push, and SQLite snapshots and continuous backup — with RaskApp.Create(args) as the entry point. On net10.0-browser it brings the WebAssembly host, the source-generated mediator, the query cache and remote dispatch. Everything referenced is wired and on; app.Configure(c => c.Jobs.Off()) is how an app does without one. Reference Rask.Server for a lean host with no database. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.20.1-alpha.0.227 | 0 | 9/4/2026 |
| 0.20.1-alpha.0.226 | 0 | 9/4/2026 |
| 0.20.1-alpha.0.225 | 0 | 9/4/2026 |
| 0.20.1-alpha.0.224 | 0 | 9/4/2026 |
| 0.20.1-alpha.0.223 | 0 | 9/4/2026 |
| 0.20.1-alpha.0.221 | 0 | 9/4/2026 |
| 0.20.1-alpha.0.220 | 0 | 9/4/2026 |
| 0.20.1-alpha.0.217 | 0 | 9/4/2026 |
| 0.20.1-alpha.0.216 | 0 | 9/4/2026 |
| 0.20.1-alpha.0.215 | 29 | 9/3/2026 |
| 0.20.1-alpha.0.213 | 26 | 9/3/2026 |
| 0.20.1-alpha.0.212 | 30 | 9/3/2026 |
| 0.20.1-alpha.0.211 | 36 | 9/3/2026 |
| 0.20.1-alpha.0.210 | 35 | 9/3/2026 |
| 0.20.1-alpha.0.209 | 35 | 9/2/2026 |
| 0.20.1-alpha.0.208 | 30 | 9/2/2026 |
| 0.20.1-alpha.0.207 | 41 | 9/2/2026 |
| 0.20.1-alpha.0.206 | 35 | 9/2/2026 |
| 0.20.1-alpha.0.204 | 42 | 9/2/2026 |
| 0.20.0 | 114 | 8/6/2026 |