Struct Response Cache Config

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.

pub struct ResponseCacheConfig {
    pub ttl_seconds: u64,
    pub namespace: String,
    pub priority: i32,
    pub bypass_rate: f64,
    pub cache_nondeterministic: bool,
    pub key_strategy: String,
    pub header_allowlist: Vec<String>,
    pub backend: BackendConfig,
}

Configuration for the adaptive plugin’s response_cache feature

Fields

ttl_seconds: u64

How long a stored answer stays reusable, in seconds.

namespace: String

Required, non-empty trust-domain partition folded into every key.

One response-cache namespace must not span mutually untrusted tenants or upstreams. The empty default is an unconfigured sentinel rejected when the response-cache section is enabled.

priority: i32

Execution-intercept priority; lower runs first/outermost (default 50).

bypass_rate: f64

Probability in [0.0, 1.0] of skipping the cache and running live.

cache_nondeterministic: bool

Cache nondeterministic requests too. Set false to cache only requests explicitly pinned deterministic (temperature = 0) - absent or unreadable temperatures count as nondeterministic.

key_strategy: String

Key strategy. Only KEY_STRATEGY_EXACT_REQUEST is supported.

header_allowlist: Vec<String>

Request headers (case-insensitive) folded into the key; never auth headers.

backend: BackendConfig

Storage backend selection.

Implementations

impl ResponseCacheConfig

impl ResponseCacheConfig

ttl

pub fn ttl(&self) -> Duration

TTL as a std::time::Duration.

Trait Implementations

impl Clone for ResponseCacheConfig

impl Clone for ResponseCacheConfig

clone

fn clone(&self) -> ResponseCacheConfig

clone_from

fn clone_from(&mut self, source: &Self)

impl Debug for ResponseCacheConfig

impl Debug for ResponseCacheConfig

fmt

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Default for ResponseCacheConfig

impl Default for ResponseCacheConfig

default

fn default() -> Self

impl<'de> Deserialize<'de> for ResponseCacheConfigwhere ResponseCacheConfig: Default,

impl<'de> Deserialize<'de> for ResponseCacheConfigwhere
    ResponseCacheConfig: Default,

deserialize

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,

impl EditorConfig for ResponseCacheConfig

impl EditorConfig for ResponseCacheConfig

editor_schema

fn editor_schema() -> &'static EditorSchema

impl Serialize for ResponseCacheConfig

impl Serialize for ResponseCacheConfig

serialize

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where
    __S: Serializer,