Logos DX
    Preparing search index...

    Interface CachePolicyState<S, H, P>

    Extended internal state for cache policy. Includes SWR tracking sets for background revalidation.

    interface CachePolicyState<S, H, P> {
        activeKeys: Set<string>;
        enabled: boolean;
        methods: Set<string>;
        revalidatingKeys: Set<string>;
        rulesCache: Map<string, CacheRule<S, H, P> | null>;
        serializer: RequestSerializer<S, H, P>;
        staleIn: number | undefined;
        ttl: number;
    }

    Type Parameters

    • S
    • H
    • P
    Index

    Properties

    activeKeys: Set<string>

    Keys currently being fetched (for SWR deduplication)

    enabled: boolean

    Whether the policy is globally enabled

    methods: Set<string>

    Set of HTTP methods this policy applies to

    revalidatingKeys: Set<string>

    Keys currently being revalidated in background

    rulesCache: Map<string, CacheRule<S, H, P> | null>

    Memoized rule cache: method:path -> resolved rule or null

    serializer: RequestSerializer<S, H, P>

    The serializer function for key generation

    staleIn: number | undefined

    Default stale time for SWR in milliseconds

    ttl: number

    Default TTL in milliseconds