Tooark.Caching
5.0.0
dotnet add package Tooark.Caching --version 5.0.0
NuGet\Install-Package Tooark.Caching -Version 5.0.0
<PackageReference Include="Tooark.Caching" Version="5.0.0" />
<PackageVersion Include="Tooark.Caching" Version="5.0.0" />
<PackageReference Include="Tooark.Caching" />
paket add Tooark.Caching --version 5.0.0
#r "nuget: Tooark.Caching, 5.0.0"
#:package Tooark.Caching@5.0.0
#addin nuget:?package=Tooark.Caching&version=5.0.0
#tool nuget:?package=Tooark.Caching&version=5.0.0
Tooark.Caching
Library for application caching in .NET projects: get-or-set with stampede protection, fail-safe, negative caching, tags, an optional Bloom filter and tenant isolation, behind a contract that hides the engine.
The engine is FusionCache (MIT), and no type of it appears in the
public API: the application depends on ICacheService and on the Tooark options, so the engine can be replaced without
changing the application. This package is the memory level, private to each instance;
Tooark.Caching.Distributed adds a server shared by the instances
(Redis, Valkey, Garnet and the managed services), and
Tooark.Mediator.Caching caches the queries of the mediator.
π Docs: Tooark.Caching on the site Β· All packages Β· API reference
π Languages: πΊπΈ English (this file) Β· π§π· PortuguΓͺs
π Contents
- Overview
- Installation
- Configuration
- Service
- Negative Caching
- Fail-safe
- Tenant Isolation
- Bloom Filter
- Expiration and Refresh
- Semantics
- Observability
- Usage Examples
- Dependencies
- Best Practices
- Error Codes and Solutions
- Contributing
- Help & Security
- Support
- License
π Overview
| Piece | What it does |
|---|---|
ICacheService |
Get-or-set, read, write, remove and remove by tag, with the tenant in the key |
CacheResult<T> |
A value, a cached "not found" or nothing cached: the result of the negative cache and of the read |
CacheEntryOptions |
Per-call options: duration, negative duration, tags, scope, eager refresh, Bloom filter |
ICacheBloomFilter |
The Bloom filter of the instance, which skips the source for keys that certainly do not exist |
AddTooarkCache |
Registers the cache with the options of the Cache section |
CacheDiagnostics |
The names of the spans and metrics, to register in OpenTelemetry |
What the cache does for each call:
- Stampede protection: simultaneous calls for the same key run the factory once; the others wait for the same value.
- Fail-safe: when the source fails and an expired value is still kept, the expired value is returned instead of the exception.
- Negative caching: a "not found" returned by the factory is cached for a short time of its own.
- Tags: entries that share a tag are removed at once.
- Jitter: each write gets a random extra time, so entries written together do not expire together.
- Tenant isolation: with an
ITenantProviderregistered, each tenant has its own entries.
The package is not part of the Tooark aggregator: it brings a third-party cache engine, which an application
without a cache does not need. Install it on its own.
π§ Installation
dotnet add package Tooark.Caching
βοΈ Configuration
appsettings.json
Only DefaultDurationSeconds is required. Every other key has a default:
{
"Cache": {
"DefaultDurationSeconds": 300,
"NegativeDurationSeconds": 30,
"JitterRatio": 0.1,
"EagerRefresh": false,
"EagerRefreshThreshold": 0.9,
"TenantScope": true,
"FailSafe": {
"Enabled": true,
"MaxStaleSeconds": 3600,
"ThrottleSeconds": 30
},
"Bloom": {
"Enabled": false,
"ExpectedItems": 1000000,
"FalsePositiveRate": 0.01
}
}
}
Program.cs
using Tooark.Caching.Injections;
builder.Services.AddTooarkCache(builder.Configuration);
// Or in code, without the section
builder.Services.AddTooarkCache(options => options.DefaultDurationSeconds = 300);
// Or the section with adjustments on top
builder.Services.AddTooarkCache(builder.Configuration, options => options.FailSafe.MaxStaleSeconds = 600);
The options are read with the strict configuration and validated at
registration: an unknown key or a value out of range fails at startup with InternalServerErrorException, not at the
first read of the cache. The Cache:Distributed subsection belongs to Tooark.Caching.Distributed, which checks it
against its own options. Only the first registration counts.
| Registration | What it registers |
|---|---|
AddTooarkCache(configuration, configure?) |
The options of the Cache section, ICacheService (scoped), the engine and ICacheBloomFilter (singletons) |
AddTooarkCache(configure) |
The same, without reading the configuration; configure must set DefaultDurationSeconds |
ICacheService is scoped because it reads the tenant of the request. In a singleton or a background service, create a
scope, as for the DbContext.
Options β Cache
| Key | Default | Description |
|---|---|---|
DefaultDurationSeconds |
(none) | Duration of the entries without their own, 1 to 31536000 (365 days). Required: the right time depends on how stale the data may get |
NegativeDurationSeconds |
30 |
Duration of a cached "not found", 1 to 86400. A record created right after keeps being answered as not found until this time ends, unless the key is removed |
JitterRatio |
0.1 |
Random extra time of each write, as a fraction of the duration, 0 to 0.5. With 300 s and 0.1, the entry lasts 300 to 330 s, in memory and in the distributed level. 0 turns it off |
EagerRefresh |
false |
Refreshes the entry in the background when it is read after EagerRefreshThreshold of its duration. The factory then runs after the call returned: see Eager refresh |
EagerRefreshThreshold |
0.9 |
Fraction of the duration after which a read starts the eager refresh, greater than 0 and less than 1 |
TenantScope |
true |
Separates the entries by tenant when an ITenantProvider is registered. Off, every entry is shared by every tenant: see Tenant Isolation |
FailSafe:Enabled |
true |
Returns the expired value when the source fails. Off, the entry leaves the cache when it expires |
FailSafe:MaxStaleSeconds |
3600 |
How long the expired value stays for the fail-safe after the entry expires, 1 to 604800. A longer time covers longer outages and keeps the entries longer in memory |
FailSafe:ThrottleSeconds |
30 |
How long the expired value returned by the fail-safe counts as valid before the source is tried again, 1 to 3600 |
Bloom:Enabled |
false |
Turns the Bloom filter of the instance on: see Bloom Filter |
Bloom:ExpectedItems |
1000000 |
How many keys the filter holds at the configured rate, 1 to 100000000. With one million keys at 1%, the filter takes about 1.2 MB |
Bloom:FalsePositiveRate |
0.01 |
Fraction of the missing keys the filter lets through, 0.0001 to 0.5. Each tenfold lower rate adds about 0.6 MB per million keys |
π§° Service
using Tooark.Caching;
using Tooark.Caching.Interfaces;
public sealed class ProductQueries(ICacheService cache, AppDbContext context)
{
private static readonly CacheEntryOptions Catalog = new() { Duration = TimeSpan.FromMinutes(10), Tags = ["products"] };
public ValueTask<IReadOnlyList<ProductDto>> ListAsync(CancellationToken cancellationToken) =>
cache.GetOrSetAsync("products:all", async token =>
(IReadOnlyList<ProductDto>)await context.Products
.Select(product => new ProductDto(product.Id, product.Name))
.ToListAsync(token),
Catalog,
cancellationToken);
}
| Method | What it does |
|---|---|
GetOrSetAsync<T>(key, factory, options?) |
Returns the cached value or runs the factory once, caches the result and returns it |
GetOrSetAsync<T>(key, factory β CacheResult) |
The same, with the negative cache: the factory says whether the value exists |
TryGetAsync<T>(key, scope?) |
Reads without calling the source: a value, a cached "not found" or Miss |
SetAsync<T>(key, value, options?) |
Caches a value, replacing whatever the key holds |
RemoveAsync(key, scope?) |
Removes the entry, in this instance, in the distributed level and, with the backplane, in the others |
RemoveByTagAsync(tag, scope?) |
Removes every entry with the tag, in the scope |
IsScopeAvailable(scope) |
Says whether the entries of the scope can be read, written and removed now |
The key is the application's key, without the tenant, which the cache adds. A blank key fails with
Cache.KeyRequired.
Entry options β CacheEntryOptions
Everything is optional; what is not set comes from the options. The options are immutable, so one instance can live in a static field and serve every call.
| Property | Default | Description |
|---|---|---|
Duration |
Cache:DefaultDurationSeconds |
How long the value is valid, greater than zero |
NegativeDuration |
Cache:NegativeDurationSeconds |
How long a cached "not found" is valid, greater than zero |
Tags |
none | Tags to remove the entry together with others, in the same scope |
Scope |
ECacheScope.Tenant |
Tenant: one copy per tenant. Shared: one copy for every tenant and without a tenant |
EagerRefresh |
Cache:EagerRefresh |
Turns the eager refresh on or off for this entry only |
UseBloomFilter |
false |
Checks the Bloom filter before the factory; in SetAsync, adds the key to the filter |
π« Negative Caching
A lookup by an id that does not exist reaches the database on every call: nothing is cached, so the next call asks again. The negative cache keeps the answer "not found" for a short time:
var result = await cache.GetOrSetAsync($"product:{id}", async token =>
{
var product = await context.Products
.Where(product => product.Id == id)
.Select(product => new ProductDto(product.Id, product.Name))
.SingleOrDefaultAsync(token);
return product is null ? CacheResult<ProductDto>.NotFound : CacheResult<ProductDto>.Found(product);
}, cancellationToken: cancellationToken);
if (!result.HasValue)
{
throw new NotFoundException("NotFound.Record;Product");
}
return result.Value!;
CacheResult<T>.Found(value)is cached for the duration of the entry;CacheResult<T>.NotFound, for the negative duration (CacheEntryOptions.NegativeDurationorCache:NegativeDurationSeconds).- The "not found" must be returned. A factory that throws β a handler that throws
NotFoundExceptionβ caches nothing, and the next call asks the source again. - A factory that returns
CacheResult<T>.Missfails withCache.Factory.ResultInvalid. - The plain
GetOrSetAsyncdoes not return a "not found": reading with it a key that holds one fails withCache.TypeMismatch. Use one form per key. - When the record is created, remove the key (or let the short negative duration end), or the new record keeps being answered as not found.
TryGetAsync tells the three states apart: HasValue, IsNotFound (a cached "not found") and IsMiss (nothing
cached).
π Fail-safe
With the fail-safe on (the default), each entry stays for FailSafe:MaxStaleSeconds more after it expires, only to be
returned when the source fails:
| When the entry expired, the factory... | The caller gets |
|---|---|
| returns a value | The new value, cached for the duration of the entry |
| throws, and the expired value is still kept | The expired value, valid for FailSafe:ThrottleSeconds: the reads in that time do not run the factory |
| throws, and there is no expired value | The exception, as it was thrown |
throws a TooarkException 4xx (except 408 and 429) |
The exception, even with an expired value; the expired value is removed |
A TooarkException 4xx β NotFoundException, ForbiddenException, BadRequestException, ConflictException β is
an answer of the source, not a failure: returning the expired value instead of it would serve a deleted record.
The 408 and 429, like the 5xx (ServiceUnavailableException, GatewayTimeoutException) and any other exception, are
failures, and turn the fail-safe on. A cached "not found" also comes back from the fail-safe when the source fails.
The fail-safe never applies to a removed entry: RemoveAsync and RemoveByTagAsync remove for good. TryGetAsync
never returns an expired value.
π’ Tenant Isolation
The cache reads the same ITenantProvider (from Tooark.Entities) as the
tenant isolation of Tooark.Entities.EntityFrameworkCore, resolved in an API by
Tooark.AspNetCore. With a provider registered β before or after
AddTooarkCache β and Cache:TenantScope on, the isolation is on:
| Situation | Entry in the Tenant scope (the default) |
Entry in the Shared scope |
|---|---|---|
| With a current tenant | One copy per tenant: the tenant goes into the key; tags are per tenant too | One copy for every tenant |
Without a current tenant (null, empty) |
Not read nor written: the factory runs on every call, and nothing is cached | One copy for every tenant |
RemoveAsync / RemoveByTagAsync without a tenant |
Fails with Cache.Tenant.NotResolved |
Removes |
No ITenantProvider registered |
Shared: there is no tenant to separate | Shared |
The cache never mixes tenants. The data of one tenant never reaches another, nor a caller without a tenant. Without a tenant, a read or a write only loses the cache (the source answers, and the Entity Framework Core filter returns nothing); a removal fails instead, because ignoring it would leave the old value of some tenant in the cache.
- Data of no tenant β reference tables, global settings β goes in the
Sharedscope:new CacheEntryOptions { Scope = ECacheScope.Shared }. A tenant's data in that scope is visible to every tenant. - The tenant resolver of
Tooark.AspNetCoreruns before the request has a tenant: a cache inside it must use theSharedscope, or it never caches. See the example. - Background code sets the tenant of its own scope before using the cache, as for the
DbContext(TenantContext.SetTenantIdinTooark.AspNetCore). The tenant is read at each call, so setting it after resolvingICacheServiceworks. Code that changes data of several tenants removes the keys of each one with that tenant set. Cache:TenantScope: falsemakes every entry shared, also in theTenantscope: the application then puts the tenant in the key of each tenant's data.
πΈ Bloom Filter
The filter answers whether a key certainly does not exist, so lookups for ids that were never created β guessed by
someone trying to bring the database down with requests that never hit the cache β do not reach the source. It is
off by default (Cache:Bloom:Enabled), lives in the memory of each instance and uses no extra package.
// At startup, before receiving traffic: every key that exists
public sealed class ProductKeysLoader(IServiceScopeFactory scopes, ICacheBloomFilter filter) : IHostedService
{
public async Task StartAsync(CancellationToken cancellationToken)
{
await using var scope = scopes.CreateAsyncScope();
var context = scope.ServiceProvider.GetRequiredService<AppDbContext>();
await foreach (var id in context.Products.Select(product => product.Id).AsAsyncEnumerable().WithCancellation(cancellationToken))
{
filter.Add($"product:{id}");
}
}
public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
}
// On each lookup
var result = await cache.GetOrSetAsync($"product:{id}", LoadAsync, new CacheEntryOptions { UseBloomFilter = true }, cancellationToken);
- What it skips: with
UseBloomFilter, a key that the filter denies is still read from the cache; with nothing cached, the call returnsCacheResult<T>.NotFoundwithout running the factory and without caching the denial. A key added to the filter is never denied; one that was not added passes at the configured false positive rate and follows the normal path. - Only the negative cache: the plain
GetOrSetAsynchas no way to answer "not found" and fails withCache.BloomFilter.ResultRequired. - Adding keys:
ICacheBloomFilter.Add(key), at startup and for every record created, orSetAsyncwithUseBloomFilter. The keys of the filter are the application's keys, without the tenant: the filter only decides whether the source is asked, and the cache and the source keep isolating the tenants. A deleted key keeps passing (a Bloom filter does not remove), and the source answers.
β οΈ Per instance. The filter is not shared, not even through the distributed level. A record created in another instance is denied here until this instance adds the key: right after the creation, the other instances answer "not found" for it. Use the filter only when every instance learns the new keys β the application adds the key from an event that every instance receives β or when that answer is acceptable. A key not added at startup is denied until it is added, so load the keys before receiving traffic (an
IHostedServicefinishes itsStartAsyncbefore the server starts).
β³ Expiration and Refresh
Jitter
Each write lasts the duration of the entry plus a random extra between zero and JitterRatio of the duration, in
memory and in the distributed level. Entries written together β at startup, after a deploy β then expire at different
moments, and do not send every query to the source at the same instant.
Eager refresh
With EagerRefresh (off by default, globally or per entry with CacheEntryOptions.EagerRefresh), a read made after
EagerRefreshThreshold of the duration returns the cached value and runs the factory in the background: a hot key
is renewed before it expires, and no read waits for the source.
β οΈ The background factory runs after the call returned. A factory that uses scoped services of the caller β the
DbContextof the request, above all β fails, because the scope may be disposed, or competes for the context with the request itself. Turn it on only for factories that do not depend on the caller's scope: one that creates its own scope orDbContext(IDbContextFactory), or that calls a singleton client.
π§ Semantics
- Removing does not guarantee the new value. A read that started before a write to the source can cache the old value after the key is removed: it loaded the old row, the writer committed and removed the key, and only then the read stored what it had loaded. The duration of the entry bounds how long that value stays. Choose durations compatible with how stale the data may get.
- Remove after the commit. Removing before the write is committed lets a read cache the old value again, and a
rollback leaves nothing to remove.
Tooark.Mediator.Cachingremoves once, after the outermost command is committed. - Values are shared references in memory. The memory level keeps the object, not a copy: every reader gets the
same instance. Cache immutable objects (records, DTOs) and never entities tracked by the
DbContext. - One type per key. Reading a key with another type fails with
Cache.TypeMismatch;SetAsyncreplaces the entry whatever its type. - The memory level is private. The engine has its own memory, separate from the application's
IMemoryCache, so their keys do not collide. Entries leave memory when they expire (with the fail-safe on,FailSafe:MaxStaleSecondslater); Tooark sets no size limit. - Distributed level. With
Tooark.Caching.Distributed, the values go to the server serialized withSystem.Text.Json: they must make the round trip (public properties with a setter or a constructor, or[JsonInclude]).
π‘ Observability
The cache emits spans and metrics of the reads, writes, removals and factory runs. Nothing is collected until the
application registers the names, which CacheDiagnostics exposes. With
Tooark.Observability:
{
"Observability": {
"Tracing": { "AdditionalSources": ["ZiggyCreatures.Caching.Fusion"] },
"Metrics": { "AdditionalMeters": ["ZiggyCreatures.Caching.Fusion"] }
}
}
Or in code, with the constants, which follow a change of engine:
builder.Services.AddTooarkOpenTelemetry(builder.Configuration, options =>
{
options.Tracing.AdditionalSources = [CacheDiagnostics.ActivitySourceName];
options.Metrics.AdditionalMeters = [CacheDiagnostics.MeterName];
});
π Usage Examples
Memory only
using Tooark.Caching;
using Tooark.Caching.Enums;
using Tooark.Caching.Injections;
using Tooark.Caching.Interfaces;
builder.Services.AddTooarkCache(builder.Configuration); // "Cache": { "DefaultDurationSeconds": 300 }
app.MapGet("/countries", (ICacheService cache, AppDbContext context, CancellationToken cancellationToken) =>
cache.GetOrSetAsync("countries", async token =>
(IReadOnlyList<CountryDto>)await context.Countries.Select(country => new CountryDto(country.Code, country.Name)).ToListAsync(token),
new CacheEntryOptions { Duration = TimeSpan.FromHours(12), Scope = ECacheScope.Shared },
cancellationToken));
Removing after a change
public async Task RenameAsync(Guid id, string name, CancellationToken cancellationToken)
{
var product = await context.Products.SingleAsync(product => product.Id == id, cancellationToken);
product.Rename(name);
await context.SaveChangesAsync(cancellationToken);
// After the commit: the key of the product and every list with the tag
await cache.RemoveAsync($"product:{id}", cancellationToken: cancellationToken);
await cache.RemoveByTagAsync("products", cancellationToken: cancellationToken);
}
Tenant resolver with cache
public sealed class OrganizationTenantResolver(AppDbContext context, ICacheService cache) : ITenantResolver
{
// The resolver runs before the request has a tenant: the mapping belongs to no tenant
private static readonly CacheEntryOptions Mapping = new() { Duration = TimeSpan.FromMinutes(30), Scope = ECacheScope.Shared };
public async ValueTask<Guid?> ResolveAsync(string externalTenantId, CancellationToken cancellationToken = default)
{
var result = await cache.GetOrSetAsync($"tenant-map:{externalTenantId}", async token =>
{
var id = await context.Tenants
.Where(tenant => tenant.OrganizationId == externalTenantId)
.Select(tenant => (Guid?)tenant.Id)
.SingleOrDefaultAsync(token);
return id is null ? CacheResult<Guid>.NotFound : CacheResult<Guid>.Found(id.Value);
}, Mapping, cancellationToken);
return result.HasValue ? result.Value : null;
}
}
Background job of one tenant
await using var scope = scopeFactory.CreateAsyncScope();
scope.ServiceProvider.GetRequiredService<TenantContext>().SetTenantId(job.TenantId);
var cache = scope.ServiceProvider.GetRequiredService<ICacheService>();
await cache.RemoveByTagAsync("reports", cancellationToken: cancellationToken); // only the reports of job.TenantId
π Dependencies
| Package | Version | Description |
|---|---|---|
Tooark.Entities |
5.x | ITenantProvider |
Tooark.Exceptions |
5.x | Configuration and usage errors |
ZiggyCreatures.FusionCache |
2.10.x | The engine, behind ICacheService |
Microsoft.Extensions.Caching.Memory |
10.x | The memory of the engine |
Microsoft.Extensions.Options.ConfigurationExtensions |
10.x | Reading the Cache section |
π― Best Practices
- Cache immutable DTOs, never entities β the memory level shares the instance with every reader.
- Return the "not found" β use the negative cache with
CacheResult<T>; throwingNotFoundExceptionin the factory caches nothing. - Remove after the commit, and choose the duration as the limit β removal narrows the window, the duration closes it.
- Put what belongs to no tenant in the
Sharedscope β and nothing of a tenant there. - Keep the eager refresh for factories without the caller's scope β the background refresh outlives the request.
- Use one form per key β plain or negative cache, and always the same type.
- Turn the Bloom filter on only when every instance learns the new keys β or when "not found" right after a creation is acceptable.
β οΈ Error Codes and Solutions
Configuration errors are InternalServerErrorException thrown at registration (AddTooarkCache), and again when the
engine is created, if services.Configure<CacheOptions> changed the options afterwards:
| Message | Description | Solution |
|---|---|---|
Options.Cache.DefaultDurationRequired |
Cache:DefaultDurationSeconds is not configured |
Set the default duration, in seconds |
Options.Cache.DefaultDurationInvalid;{min};{max} |
DefaultDurationSeconds outside 1 to 31536000 |
Use a value in the range |
Options.Cache.NegativeDurationInvalid;{min};{max} |
NegativeDurationSeconds outside 1 to 86400 |
Use a value in the range |
Options.Cache.JitterRatioInvalid |
JitterRatio outside 0 to 0.5 |
Use a fraction, such as 0.1; 0 turns it off |
Options.Cache.EagerRefreshThresholdInvalid |
EagerRefreshThreshold not between 0 and 1 (exclusive) |
Use a fraction, such as 0.9 |
Options.Cache.FailSafe.MaxStaleInvalid;{min};{max} |
FailSafe:MaxStaleSeconds outside 1 to 604800 |
Use a value in the range |
Options.Cache.FailSafe.ThrottleInvalid;{min};{max} |
FailSafe:ThrottleSeconds outside 1 to 3600 |
Use a value in the range |
Options.Cache.Bloom.ExpectedItemsInvalid;{min};{max} |
Bloom:ExpectedItems outside 1 to 100000000 |
Use a value in the range |
Options.Cache.Bloom.FalsePositiveRateInvalid;{min};{max} |
Bloom:FalsePositiveRate outside 0.0001 to 0.5 |
Use a fraction in the range |
Options.Configuration.UnknownKey;Cache;{key} |
Unknown key in Cache, with strict configuration on |
Fix the key name, or remove it from the section |
Call errors are InternalServerErrorException thrown by ICacheService:
| Message | Description | Solution |
|---|---|---|
Cache.KeyRequired |
Blank key, also in ICacheBloomFilter |
Pass a key |
Cache.TagRequired |
Blank tag, in RemoveByTagAsync or in CacheEntryOptions.Tags |
Pass a tag, or leave the blank one out |
Cache.Entry.DurationInvalid |
CacheEntryOptions.Duration zero or negative |
Use a positive duration |
Cache.Entry.NegativeDurationInvalid |
CacheEntryOptions.NegativeDuration zero or negative |
Use a positive duration |
Cache.Tenant.NotResolved |
Removal in the Tenant scope without a current tenant |
Set the tenant of the scope, or use the Shared scope for data of no tenant |
Cache.TypeMismatch;{key} |
The key holds another type, or a "not found" read by the plain GetOrSetAsync |
Use one type and one form per key |
Cache.Factory.ResultInvalid |
The factory of the negative cache returned CacheResult<T>.Miss |
Return Found(value) or NotFound |
Cache.BloomFilter.ResultRequired |
UseBloomFilter in the plain GetOrSetAsync |
Use the GetOrSetAsync whose factory returns CacheResult<T> |
Cache.ScopeNotSupported;{scope} |
A value outside ECacheScope |
Use Tenant or Shared |
π€ Contributing
Contributions are welcome! Start with CONTRIBUTING.md β it covers the development workflow, the coding and commit conventions and the pull request checklist. Bugs and feature requests go through the issue templates of the Tooark repository.
By participating you agree to the Code of Conduct.
π Help & Security
- β Questions, bugs, feature ideas β see SUPPORT.md for the right channel
- π Security vulnerabilities β do not open a public issue; follow SECURITY.md
π Support
If Tooark helps your projects, consider supporting its development:
- π GitHub Sponsors
- β Ko-fi
Every contribution helps keep the project maintained and improving. Thank you! π
π License
This project is licensed under the BSD 3-Clause License.
| 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.Extensions.Caching.Memory (>= 10.0.15)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Localization (>= 10.0.15)
- Microsoft.Extensions.Options (>= 10.0.15)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.15)
- Tooark.Entities (>= 5.0.0)
- Tooark.Exceptions (>= 5.0.0)
- ZiggyCreatures.FusionCache (>= 2.10.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Tooark.Caching:
| Package | Downloads |
|---|---|
|
Tooark.Caching.Distributed
Library that adds the distributed level to Tooark.Caching over one connection string to a RESP server (Redis, Valkey, Garnet, Amazon ElastiCache, Azure Cache for Redis, Google Memorystore): shared cache, backplane between instances and distributed stampede lock. |
|
|
Tooark.Mediator.Caching
Library that caches Tooark.Mediator queries with Tooark.Caching and removes the keys and tags declared by the commands once, after the outermost command completes and its unit of work is committed. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 5.0.0 | 0 | 12/1/2026 |