Vana SDK - v2.2.2
    Preparing search index...

    Interface Cache<TKey, TValue>

    Defines a generic caching interface with TTL support.

    Provides standard cache operations for performance optimization and reducing redundant computations or network requests.

    interface Cache<TKey = string, TValue = unknown> {
        get(key: TKey): Promise<TValue | undefined>;
        set(key: TKey, value: TValue, ttl?: number): Promise<void>;
        delete(key: TKey): Promise<boolean>;
        clear(): Promise<void>;
        has(key: TKey): Promise<boolean>;
    }

    Type Parameters

    • TKey = string

      Type of cache keys

    • TValue = unknown

      Type of cached values

    Implemented by

    Index

    Methods