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
QInMemoryCacheimplementation backs theIQCachefeature afterModule.setup(). - Register the module in the bootstrap pipeline before any code calls
getCache().