AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Nestjs Caching Queues

skill-dkmqflx-nestjs-best-practices-plugin-nestjs-caching-queues · by dkmqflx

NestJS caching and background-job queue best practices. Use when adding caching or async job processing to NestJS — CacheModule, cache-manager, Redis, or BullMQ/Bull queues. Triggers on CacheModule, @InjectQueue, @Processor, cache TTL, or background jobs.

No reviews yet
0 installs
27 views
0.0% view→install

Install

$ agentstack add skill-dkmqflx-nestjs-best-practices-plugin-nestjs-caching-queues

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-dkmqflx-nestjs-best-practices-plugin-nestjs-caching-queues)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Nestjs Caching Queues? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

NestJS Caching & Queues

Best practices for two related NestJS performance techniques: caching (@nestjs/cache-manager, backed by Keyv/Redis) and background-job queues (@nestjs/bullmq, backed by Redis). Caching avoids recomputing or re-fetching hot data; queues move slow or unreliable work off the request path so HTTP responses stay fast. Both are Redis-backed in production and share the same core concern: predictable behavior under load and failure.

Verified against the NestJS v10/v11 docs (techniques/caching, techniques/queues). Note the units gotcha: cache TTLs are in milliseconds since @nestjs/cache-manager v2 / cache-manager v5+.

When to Apply

Reference these rules when:

  • Registering CacheModule or injecting CACHE_MANAGER / using CacheInterceptor
  • Choosing a cache store (in-memory dev vs. Redis prod via @keyv/redis)
  • Setting or debugging cache TTLs and cache invalidation
  • Deciding whether work belongs inline or in a queue (email, image/video processing, external API calls)
  • Wiring BullModule, @InjectQueue, or a @Processor consumer
  • Configuring retries/backoff, or scaling workers as a separate deployment

Rules

| Rule | Impact | Topic | |------|--------|-------| | cache-module-setup | HIGH | Register CacheModule globally; in-memory for dev, Redis for prod | | set-sensible-ttl | HIGH | Always set a TTL (in ms); never leave caches unbounded | | cache-keys-explicit | HIGH | Deterministic, namespaced keys; invalidate on writes | | offload-heavy-work-to-queues | CRITICAL | Move slow/external work off the request path into a queue | | idempotent-processors | CRITICAL | Processors must tolerate retries and duplicate deliveries | | retries-and-backoff | HIGH | Configure attempts + exponential backoff for transient failures | | separate-worker-process | MEDIUM | Run consumers as a separate process/deployment for scaling & isolation |

How to Use

  1. Caching first. Start with cache-module-setup, then apply set-sensible-ttl and cache-keys-explicit to every cached value — a cache without a TTL or an invalidation story is a correctness bug, not just a performance one.
  2. Queues for anything slow or flaky. Apply offload-heavy-work-to-queues to decide what to enqueue, then idempotent-processors and retries-and-backoff to make the consumer safe to re-run. These two are CRITICAL: BullMQ retries and at-least-once delivery mean a non-idempotent processor will double-charge, double-send, or corrupt data.
  3. Scale out. Apply separate-worker-process when CPU-bound jobs threaten the event loop or you need to scale producers and consumers independently.

Each rule file shows an Incorrect and Correct example. Prefer BullMQ (@nestjs/bullmq) for new projects; Bull (@nestjs/bull) is in maintenance mode.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.