@lazarv/react-server/memory-cache
Default in-memory cache provider. Exposes useCache, invalidate, and the client-side helpers used when the runtime's built-in cache is active.
function invalidate(keys: string[]): Promise<void>;
Invalidate the cache for the given keys.
Parameters
keys— The keys to invalidate
Returns — A promise that resolves when the cache is invalidated
function useCache<T>(keys: string[], value: (() => Promise<T>) | T, ttl?: number, force?: boolean): Promise<T>;
Get from cache or set the value in the cache with the given keys for the given time to live.
Parameters
keys— The keys to cache the value withvalue— The value to cachettl— The time to live in millisecondsforce— Whether to force cache overwrite
Returns — The cached value
type StorageCache = import("./storage-cache").default;