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

    Interface CacheConfig

    Cache configuration for optimizing repeated data fetches.

    Configures in-memory caching behavior to reduce redundant API calls and improve performance. The cache automatically evicts expired entries based on TTL and removes least-recently-used items when maxSize is reached. Use appropriate TTL values based on your data freshness requirements.

    // Short-lived cache for frequently changing data
    const userCache: CacheConfig = {
    ttl: 60000, // 1 minute
    maxSize: 100, // Store up to 100 users
    prefix: 'user:' // Cache keys like 'user:123'
    };

    // Long-lived cache for stable data
    const schemaCache: CacheConfig = {
    ttl: 3600000, // 1 hour
    maxSize: 1000, // Store up to 1000 schemas
    prefix: 'schema:'
    };

    // Disable caching by setting TTL to 0
    const noCache: CacheConfig = {
    ttl: 0 // No caching
    };
    interface CacheConfig {
        ttl: number;
        maxSize?: number;
        prefix?: string;
    }
    Index

    Properties

    Properties

    ttl: number

    Cache TTL in milliseconds

    maxSize?: number

    Maximum cache size

    prefix?: string

    Cache key prefix