Settings
Options are passed when the ferncache client is created. Every option is optional; the defaults suit most applications.
Options
| Option | Type | Default | Description |
|---|---|---|---|
max_entries | u64 | 10_000 | Maximum number of entries. Zero means no limit (use cost instead). |
default_ttl | Duration | 5m | Time-to-live applied to inserts without an explicit TTL. |
shards | u64 | 64 | Number of shards. Must be a power of two. |
max_cost | u64 | 67_108_864 | Upper bound for the summed cost of all entries. |
record_stats | bool | true | Collect hit, miss and eviction counters. |
cleanup_interval | Duration | 1m | How often idle shards are swept for expired entries. |
Durations are given in std::time::Duration.