Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add leejpsd/nextjs-cache-handler --skill nextjs-redis-cachegit clone --depth 1 https://github.com/leejpsd/nextjs-cache-handlerWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/leejpsd/nextjs-cache-handler/nextjs-redis-cache)<a href="https://agentmods.dev/skills/leejpsd/nextjs-cache-handler/nextjs-redis-cache"><img src="https://agentmods.dev/badge/skills/leejpsd/nextjs-cache-handler/nextjs-redis-cache/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/leejpsd/nextjs-cache-handler/nextjs-redis-cache"><img src="https://agentmods.dev/badge/skills/leejpsd/nextjs-cache-handler/nextjs-redis-cache.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00119 | $0.02599 |
| Opus 5.5 | $0.00048 | $0.01040 |
| Sonnet 5.5 | $0.00024 | $0.00520 |
| Haiku 4.5 | $0.00012 | $0.00260 |
Grade A, and why
nextjs-redis-cache scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
- **ISR round-trip**: `curl -D- <url>` twice → `x-nextjs-cache: MISS` then `HIT`; How it starts
The opening of the file, as written. The whole thing — 183 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Next.js Redis Cache Handler
@leejpsd/nextjs-cache-handler is a Redis cache handler for self-hosted
Next.js 15/16. It is the only Redis-backed package shipping BOTH handler
interfaces: cacheHandler (ISR / Pages Router / fetch cache) and
cacheHandlers ('use cache', cacheComponents: true).
Do NOT use it on Vercel-hosted apps — Vercel provides its own managed cache. The target is multi-instance self-hosting: ECS/Fargate, Kubernetes, VMs behind a load balancer.
Version rule: always install >= 0.3.3. Earlier 0.3.x have an incomplete soft-invalidation path (issue #1).
1. Which handler(s) — decision table
| Next.js version | cacheHandler (ISR) |
cacheHandlers ('use cache') |
|---|---|---|
| 15.x | ✅ use it | ❌ does not exist in Next 15 |
| >= 16.1.5 | ✅ use it | ✅ use it (cacheComponents: true) |
| < 15 | ❌ unsupported (peer next >=15.0.0 <17) |
❌ |
Detect the version from the app's package.json (dependencies.next).
Install: npm i @leejpsd/nextjs-cache-handler plus ONE client:
redis (node-redis v5) or ioredis (required for Cluster/Sentinel).
2. Wiring recipe (exact files)
Create TWO CommonJS wrapper files in the project root (Next's
require.resolve needs CJS):
// cache-components.cjs (Next 16 only)
const { createCacheComponentsHandler } = require("@leejpsd/nextjs-cache-handler/cache-components");
module.exports = createCacheComponentsHandler({
client: { type: "redis", url: process.env.REDIS_URL },
buildNamespace: () => process.env.DEPLOYMENT_VERSION,
});
// cache-incremental.cjs (Next 15 and 16)
const { createIncrementalCacheHandler } = require("@leejpsd/nextjs-cache-handler/incremental");
module.exports = createIncrementalCacheHandler({
client: { type: "redis", url: process.env.REDIS_URL },
buildNamespace: () => process.env.DEPLOYMENT_VERSION,
});
// next.config.ts — the four load-bearing keys
const nextConfig = {
cacheComponents: true, // Next 16 only
cacheHandler: require.resolve("./cache-incremental.cjs"),
cacheHandlers: { default: require.resolve("./cache-components.cjs") }, // Next 16 only
cacheMaxMemorySize: 0, // REQUIRED: disable Next's local LRU so multi-instance reads hit Redis
};
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 183 lines · 119 tokens per session scan A d4d7a5f59d6a
nextjs-redis-cache is a skill published in the GitHub repository leejpsd/nextjs-cache-handler (6 stars, last pushed 1mo ago), licensed MIT. It adds 119 tokens to every session and 2,599 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
using-redis-token-buckets
Use when adding a bucket-like rate limit backed by Redis: a per-caller budget with burst capacity and continuous refill, a refund path for requests that did no work, or a limit whose Retry-After must be a real wait rather than a window edge. posthog/tokenbucket.py provides an atomic Lua token bucket (consume, refund…
spring-data-redis
Use when implementing caching, session storage, rate limiting, or any Redis integration. Covers cache-aside pattern, key naming, TTL strategy, and serialization config.
using-redis-token-buckets
Use when adding a bucket-like rate limit backed by Redis: a per-caller budget with burst capacity and continuous refill, a refund path for requests that did no work, or a limit whose Retry-After must be a real wait rather than a window edge. posthog/tokenbucket.py provides an atomic Lua token bucket (consume, refund…
bull-mq
Runs background jobs in Node.js with BullMQ, a job queue library backed by Redis (or PostgreSQL since v6): delayed and prioritized jobs, retries with backoff, rate limiting, cron-style job schedulers, parent-child flows and concurrency control. Use when a user asks to add a background worker, queue emails or webhooks…
cache-strategy
Design and implement caching layers for APIs and web applications using Redis or Memcached. Use when you need to reduce database load, improve response times, or handle traffic spikes. Covers cache-aside, write-through, and write-behind patterns, TTL strategies, cache invalidation, and stampede prevention. Trigger…
python-redis-module-skill
A Python integration guide for adding Redis to an existing FastAPI project. Redis is a fast shared data store commonly used for temporary data, sessions, locks, counters, and messages.