Cache configuration for in-memory data caching and performance optimization
caches
The caches clause defines one or more named in‑memory caches. Caches allow
pipelines (actions, backends, scripts, etc.) to store and reuse values for a
limited time, reducing repeated backend lookups and improving overall
performance.
Each cache sub‑block declares a logical key space where keys map to a
collection (vector) of values. Entries can optionally expire automatically if a
default timeout is configured, or per insertion when values are written.
Only the metadata (cache names and default timeouts) is configured here. The actual insertion, lookup, and invalidation operations occur at runtime via pipeline actions (e.g. actions that add or read cached values inside AAA processing) or management APIs.
Syntax
caches {
cache "NAME" {
# Optional default expiration in milliseconds
default_timeout 60000;
}
cache "SESSIONS" {
default_timeout 1800000; # 30 minutes
}
}
Cache block
A cache block supports:
| Directive | Type | Required | Description |
|---|---|---|---|
default_timeout | number (ms) | No | Default TTL applied to inserted keys if the insertion call does not override it |
If default_timeout is omitted, keys inserted without an explicit timeout will
persist until explicitly removed or the process restarts.
Example
caches {
cache "USER_ATTRIBUTES" {
default_timeout 300000; # 5 minutes
}
cache "SESSION_DATA" {
default_timeout 1800000; # 30 minutes
}
}