Skip to main content

Quickstart

import { Module as CacheModule } from '@quik/cache';

await CacheModule.setup({ /* bootstrap options */ });
import { getCache } from '@quik/cache';

const cache = getCache();

await cache.set('user:1', { name: 'Alice' }, 60_000); // 60 s TTL
const user = await cache.get<{ name: string }>('user:1');

if (await cache.has('user:1')) {
await cache.delete('user:1');
}

await cache.clear(); // wipe all entries

Notes

  • The built-in QInMemoryCache implementation backs the IQCache feature after Module.setup().
  • Register the module in the bootstrap pipeline before any code calls getCache().