Iskra API Reference
    Preparing search index...

    Interface CacheConfig

    interface CacheConfig {
        adapter: "memory" | "redis";
        commandTimeoutMs?: number;
        connection?: {
            db?: number;
            host?: string;
            password?: string;
            port?: number;
            tls?: boolean | ConnectionOptions;
            url?: string;
            username?: string;
        };
        maxEntries?: number;
        secret?: string;
        ttl?: number;
    }
    Index
    adapter: "memory" | "redis"
    commandTimeoutMs?: number

    Redis: how long a command may take before it fails, in ms (default 2000). While Redis is down, requests that use the cache (rate limiting, cache-backed sessions) fail after this instead of hanging through the client's reconnect attempts.

    connection?: {
        db?: number;
        host?: string;
        password?: string;
        port?: number;
        tls?: boolean | ConnectionOptions;
        url?: string;
        username?: string;
    }

    Type Declaration

    • Optionaldb?: number
    • Optionalhost?: string
    • Optionalpassword?: string
    • Optionalport?: number
    • Optionaltls?: boolean | ConnectionOptions

      Connect over TLS: true, or Node tls.connect options (ca, servername...).

    • Optionalurl?: string

      redis://[user:password@]host:port/db, or rediss:// for TLS (managed Redis: Upstash, ElastiCache with in-transit encryption). The other fields, when given, take precedence over the URL's.

    • Optionalusername?: string

      ACL user (Redis 6+).

    maxEntries?: number

    Memory adapter only: most entries kept (default 100 000). Past it the oldest writes are dropped; expired entries are swept every minute.

    secret?: string

    Ignored.

    ttl?: number

    Ignored: pass a TTL to each set().