Rask.Cache
0.23.1-alpha.0.70
See the version list below for details.
dotnet add package Rask.Cache --version 0.23.1-alpha.0.70
NuGet\Install-Package Rask.Cache -Version 0.23.1-alpha.0.70
<PackageReference Include="Rask.Cache" Version="0.23.1-alpha.0.70" />
<PackageVersion Include="Rask.Cache" Version="0.23.1-alpha.0.70" />
<PackageReference Include="Rask.Cache" />
paket add Rask.Cache --version 0.23.1-alpha.0.70
#r "nuget: Rask.Cache, 0.23.1-alpha.0.70"
#:package Rask.Cache@0.23.1-alpha.0.70
#addin nuget:?package=Rask.Cache&version=0.23.1-alpha.0.70&prerelease
#tool nuget:?package=Rask.Cache&version=0.23.1-alpha.0.70&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 surface that reads as a sentence, with nothing injected:
Cache.Remember(key, load).For(10.Minutes)read-through, plusCache.Get<T>/Cache.Set(key, value).For(…)/Cache.Forget(JSON under the hood).ICachewords the same calls for a hosted service or a timer. - 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.Remember($"rates:{date:yyyyMMdd}", ct => exchange.FetchRatesAsync(date, ct))
.Sliding(10.Minutes);
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.
Isolated per tenant. In a multi-tenant app the database-backed store scopes each key to the tenant in flight, so every tenant gets its own value under the same name and cannot read another's; with no tenant the key is stored as given, which keeps anonymous session and output caching working.
Trim / AOT: the typed
Remember<T>/Get<T>/Set<T>surface round-trips values throughSystem.Text.Json, which by default means reflection. In a trimmed or AOT app, name a source-generatedJsonSerializerContextonce —o.Json = AppJson.Default— and every call stays as it is. 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. net11.0 is compatible. |
-
net10.0
- Microsoft.EntityFrameworkCore (>= 10.0.12)
- Microsoft.Extensions.Caching.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- Rask.Data (>= 0.23.1-alpha.0.70)
-
net11.0
- Microsoft.EntityFrameworkCore (>= 10.0.12)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
- Rask.Data (>= 0.23.1-alpha.0.70)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Rask.Cache:
| Package | Downloads |
|---|---|
|
Rask.Server
The ASP.NET host for Rask, a full-stack .NET web framework, with every battery: database (SQLite, PostgreSQL or SQL Server, picked by Rask:Database:Provider), mediator and query cache, accounts, background jobs, transactional email, cache, file storage, outbox, operator dashboard, durable logs, Web Push, SQLite snapshots and continuous backup. Renders Rask components with live updates over a WebSocket. RaskApp.Create(args).Run<App>() is the whole Program.cs; app.Configure(c => c.Jobs.Off()) is how an app does without one. Depends on Rask, the shared core. |
|
|
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, cache and stored files 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.23.1-alpha.0.84 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.82 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.81 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.80 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.79 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.78 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.76 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.74 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.72 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.70 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.69 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.68 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.67 | 0 | 9/25/2026 |
| 0.23.1-alpha.0.66 | 25 | 9/24/2026 |
| 0.23.1-alpha.0.65 | 30 | 9/24/2026 |
| 0.23.1-alpha.0.64 | 27 | 9/24/2026 |
| 0.23.1-alpha.0.62 | 35 | 9/24/2026 |
| 0.23.1-alpha.0.61 | 26 | 9/24/2026 |
| 0.23.1-alpha.0.50 | 33 | 9/24/2026 |
| 0.23.0 | 149 | 9/18/2026 |