{"repo":"77hdumat/nestjs-cachex","free":true,"listed":false,"github":"https://github.com/77hdumat/nestjs-cachex","clone":"git clone https://github.com/77hdumat/nestjs-cachex.git","description":null,"language":"TypeScript","stars":18,"topics":["aop","cache","msgpack","nestjs","redis","swr","typescript","single-flight"],"license":null,"category":"databases-storage","readme_excerpt":"English 한국어 日本語 nestjs-cachex A decorator-based caching module for NestJS. SWR, Single-flight, msgpack + zstd, and multi-level cache — all in one package. --- Introduction Most caching modules work well as long as the cache is alive. The moment TTL expires, every subsequent request hits the DB or external API directly, and under load, this leads to Cache Stampede. nestjs-cachex solves this at the root. - SWR — Even after TTL expires, the stale data is returned immediately while the cache is refreshed in the background. - Single-flight — A Redis distributed lock and Pub/Sub ensure that only one refresh runs per key, even across multiple instances. - Multi-level cache — L1 (in-memory) and L2 (Redis) in a layered structure, eliminating unnecessary network overhead. Feature @nestjs/cache-manager nestjs-cachex --- --- --- SWR ✗ ✓ Single-flight ✗ ✓ Distributed lock ✗ ✓ msgpack serialization ✗ ✓ zstd compression ✗ ✓ Multi-level cache ✗ ✓ --- Quick Start --- Features - Decorator-based — Separate caching logic from business code entirely with @Cacheable and @CacheEvict - SWR — Instant response even on cache expiry. Revalidation happens in the background - Single-flight — Distributed lock + Pub/Sub guarantees a single refresh per key, even across instances - Jitter — Random TTL offset prevents synchronized expiration and Cache Stampede - msgpack — Binary serialization instead of JSON — smaller payload, faster throughput - zstd compression — Data exceeding the threshold is compressed au","default_branch":null,"files":null,"tree":[],"storefront":"/r/77hdumat","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/77hdumat/nestjs-cachex/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}