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), Lua scripts, or management APIs.

Syntax

caches {
    cache "NAME" {
        # Optional default expiration
        default_timeout 60s;
    }

    cache "SESSIONS" {
        default_timeout 30m;  # 30 minutes
    }
}

Cache block

A cache block supports:

DirectiveTypeRequiredDescription
default_timeoutdurationNoDefault TTL applied to inserted keys if the insertion call does not override it. See Duration Units.

If default_timeout is omitted, keys inserted without an explicit timeout will persist until explicitly removed or the process restarts.

See Lua cache API documentation for usage examples including rate limiting.

Example

caches {
    cache "USER_ATTRIBUTES" {
        default_timeout 5m;  # 5 minutes
    }

    cache "SESSION_DATA" {
        default_timeout 30m;  # 30 minutes
    }

    cache "RATE_LIMIT" {
        default_timeout 1h;  # 1 hour
    }
}