AiSkillz

Early "As-Is" Access - free for the first 20 accounts. 18 of 20 places left: complete registration to claim one. No credit card needed.

← Back to skills
Backend & APIsVia MCPAny / model-agnosticLicense: My own work (all rights reserved)

Node.js Caching Patterns

Created by CodeCraft LLC

Add and review caching in Node.js services

Product and technology names are trademarks of their respective owners, used only to identify what this skill covers. CodeCraft LLC is not affiliated with or endorsed by them.

by Jace (@jamick)v1.5.0 · updated 2026-12-01Report copyright infringement

Description

Add and review caching in Node.js services - the cache-aside pattern with invalidation on write, in-process caches (node-cache, lru-cache) and when per-pod copies are wrong, Redis with ioredis (TTLs, JSON serialization, retry and offline-queue settings, failing open when Redis is down), cache stampede prevention (in-process promise sharing, Redis locks with owner-checked release), invalidation strategies (TTL, delete-on-write, tag sets), HTTP Cache-Control, stale-while-revalidate and ETags, what must never be cached, and measuring hit rate. Use whenever the user adds Redis or a cache to a Node API, an endpoint is slow or hammers the database, the database falls over when a hot key expires, users see stale or someone else's data, or the user asks about TTLs, cache invalidation or HTTP caching headers.

#backend#nodejs#caching

Included with all-access

$9.00 one-time, permanent access

Get all-access · $12.00/mo, billed yearly

or

Buy 2 or more together for up to 40% off · View cart

You get a licence, not ownership. Access lasts while this skill is available on AiSkillz; if it's removed within 90 days of purchase, we'll send you a copy to keep. Terms

Official and free skills are included with the all-access subscription

Changelog

Subscribers also see which files changed in each version.

v1.5.0Dec 1, 2026Latest

Changed

  • Client choice now follows the ioredis README (node-redis recommended for new projects; ioredis stable, best-effort maintenance) instead of Redis's website, whose docs are CC BY-NC-SA (non-commercial). Sources re-pointed to the node-redis and ioredis READMEs (MIT).
v1.4.2Dec 1, 2026

Added

  • README: a **Sources** line listing the official pages the skill is written from, each link checked, so the source-overlap check can run against them.
v1.4.1Nov 29, 2026

Changed

  • Added a contents list to reference files over 100 lines (stampede-and-invalidation.md, cache-aside-memory-redis.md), so a partial read still shows every section.
v1.4.0Nov 28, 2026

Fixed

  • Cache helpers now fail open (catch Redis errors and fall back to the source), matching the skill's own rule; the cache-aside example's truthiness check treated cached falsy values as misses.
  • Tag invalidation no longer uses a multi-key DEL, which fails with CROSSSLOT in Redis Cluster (the skill's own pitfall); per-key UNLINK in chunks.
  • ETag check uses req.fresh instead of a string compare that missed weak validators and lists.

Changed

  • Checked against the npm registry, redis.io client docs, the lru-cache and node-cache repos, RFC 9213 and the Express API (November 2026).
  • Client guidance: node-redis recommended for new projects, ioredis 6 for existing code, Valkey GLIDE for Valkey; node-cache unmaintained since 2020, lru-cache 11 for new in-process caches (example added).
  • Deep-dive section made on-demand with open/skip triggers.

Added

  • Command timeout, Vary, CDN-Cache-Control, lru-cache ms TTL pitfall, checklist items.
v1.3.0Nov 20, 2026

Added

  • Review method: every code review starts by mapping the code flows in scope and gives each flow its own sub-agent at high effort, which reviews that flow end to end against this checklist; the main agent merges, re-checks Blockers and de-duplicates. Covers single-flow reviews, nested sub-agents, failed sub-agents and environments without sub-agents.
v1.2.0Nov 6, 2026

Changed

  • Review report rule: reviews that cover changes (a diff, PR or uncommitted work) open with a short "What the changes do" section - factual bullets grouped by purpose, inferred intent marked, deploy or migration impact stated.
v1.1.0Nov 4, 2026

Changed

  • Review report rule at the top of the skill, loaded before any review: one entry per finding as Level · type · file:line · finding · proposed fix, outside facts sourced or marked unverified, and no narrative.
v1.0.0Oct 16, 2026

Added

  • First release.