---
title: "openvibe-sdk/cache · OpenVibe.Services"
canonical: "https://openvibe.services/docs/sdk/cache"
updated: null
---

# openvibe-sdk/cache · OpenVibe.Services

HTML: [openvibe-sdk/cache · OpenVibe.Services](https://openvibe.services/docs/sdk/cache)

# `openvibe-sdk/cache`

Generated at 2026-12-01 05:42:00 UTC from [`openvibe-contracts v0.454.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.454.0) and [`openvibe-sdk v0.193.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.193.0).

From `types/cache.d.ts` (server only). Declarations are shown verbatim.

## interface Cache

~~~~
export interface Cache {
    get<T = unknown>(key: string): Promise<T | undefined>;
    set(key: string, value: unknown, ttlSec?: number, opts?: { tags?: string[] }): Promise<void>;
    del(...keys: string[]): Promise<number>;
    /** One load per key across processes (single-flight plus a short lock). */
    getOrSet<T>(key: string, ttlSec: number, loader: () => Promise<T>, opts?: { tags?: string[] }): Promise<T>;
    invalidateTag(tag: string): Promise<number>;
    stats(): { hits: number; misses: number; loads: number; errors: number; store: 'valkey' | 'memory' };
}
~~~~

## export export function createCache(opts?: { valkey?: Valkey | null;

~~~~
export function createCache(opts?: { valkey?: Valkey | null; namespace?: string; ttlSec?: number; lockMs?: number; waitMs?: number; memoryMax?: number; log?: { warn(msg: string): void } }): Cache;
~~~~
