HybridCache configuration helper for Fluens builder infrastructure.
$ dotnet add package Fluens.CachingHybridCache configuration helper for Fluens builder infrastructure.
dotnet add package Fluens.Caching
fluensBuilder.AddCaching(opts =>
{
opts.DefaultExpirationSeconds = 300; // default: 300 (5 min)
opts.DefaultLocalExpirationSeconds = 60; // default: 60 (1 min)
opts.MaximumPayloadBytes = 1_048_576; // default: 1 MB
opts.MaximumKeyLength = 1024; // default: 1024
});
Configuration section: Fluens:Caching. Consumers inject HybridCache directly.
| Property | Type | Default | Description |
|---|---|---|---|
Enabled | bool | true | When false, no caching services are registered |
DefaultExpirationSeconds | int | 300 | L2 (distributed) cache expiration in seconds |
DefaultLocalExpirationSeconds | int | 60 | L1 (in-memory) cache expiration in seconds |
MaximumPayloadBytes | int | 1048576 | Maximum serialized size of a cache entry in bytes |
MaximumKeyLength | int | 1024 | Maximum length of a cache key |
This project is licensed under the MIT License.