Logos DX
    Preparing search index...

    Interface CacheRule<S, H, P>

    Rule for matching specific routes in cache configuration.

    interface CacheRule<S = unknown, H = unknown, P = unknown> {
        enabled?: boolean;
        endsWith?: string;
        includes?: string;
        is?: string;
        match?: RegExp;
        methods?: _InternalHttpMethods[];
        serializer?: RequestSerializer<S, H, P>;
        skip?: (ctx: RequestKeyOptions<S, H, P>) => boolean;
        staleIn?: number;
        startsWith?: string;
        ttl?: number;
    }

    Type Parameters

    • S = unknown
    • H = unknown
    • P = unknown

    Hierarchy (View Summary)

    Index

    Properties

    enabled?: boolean

    Enable/disable caching for matching routes

    endsWith?: string

    Path must end with this suffix

    includes?: string

    Path must contain this substring

    is?: string

    Exact path match

    match?: RegExp

    Path must match this regular expression

    HTTP methods this rule applies to

    serializer?: RequestSerializer<S, H, P>

    Override serializer for this rule

    skip?: (ctx: RequestKeyOptions<S, H, P>) => boolean

    Skip caching for this rule based on request context

    staleIn?: number

    Time until stale for SWR (ms)

    startsWith?: string

    Path must start with this prefix

    ttl?: number

    TTL for cached responses (ms)