Libraries
    Preparing search index...

    Interface CacheTagMiddlewareOptions

    Configuration for the cacheTags middleware.

    interface CacheTagMiddlewareOptions {
        condition?: (response: Response) => boolean;
        defaultTtl?: number;
        ttlByTag?: Record<string, number>;
    }
    Index

    Properties

    condition?: (response: Response) => boolean

    Predicate that decides whether a request should be cached. Defaults to caching only successful responses (response.ok).

    defaultTtl?: number

    Default TTL in milliseconds for tags without an explicit TTL. Defaults to 0 (no caching — invalidation-only mode).

    ttlByTag?: Record<string, number>

    Per-tag TTL map: { [tagName]: ttlMs }. Tags not listed here fall back to defaultTtl.