Implement intelligent API response caching with Redis, Memcached, and CDN integration.

MITAuto-check passedBackend & APIs

Install Managing API Cache

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill managing-api-cache -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace managing-api-cache --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/managing-api-cache .claude/skills/managing-api-cache && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
managing-api-cache
GitHub stars
2.8k
Token cost
~1.4k tokens
SKILL.md length
567 words
Files
4 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Implement intelligent API response caching with Redis, Memcached, and CDN integration.

  • Works in 9 steps: Analyze endpoint characteristics using… → Implement cache key generation… → Build a cache-aside middleware that… → …
  • Optimizing API performance with caching
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Managing API Cache is an agent skill from jeremylongshore/tons-of-skills-marketplace. Implement intelligent API response caching with Redis, Memcached, and CDN integration. Use when optimizing API performance with caching. Trigger with phrases like "add caching", "optimize API performance", or "implement cache layer".

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/errors.md`, `references/examples.md` and `references/implementation.md`). Compatibility notes: Designed for Claude Code

It sits in Backend & APIs, covering Caching. It works with Redis. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Optimizing API performance with caching
  • With phrases like add caching
  • Optimize API performance
  • Implement cache layer

Example prompts

  • “add caching”
  • “optimize API performance”
  • “implement cache layer”
  • “/managing-api-cache”

Requirements

  • Node.js
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Grep, Glob, Bash(api:cache-*)

Workflow steps

9 steps, taken from the first numbered list in SKILL.md.

  1. Analyze endpoint characteristics using Read and Grep to classify endpoints by cacheability: fully cacheable (static data), conditionally…
  2. Implement cache key generation middleware that creates deterministic keys from method, path, query parameters (sorted), and relevant…
  3. Build a cache-aside middleware that checks the cache before executing the handler, returning cached responses with X-Cache: HIT header, or…
  4. Configure TTL per endpoint category: long TTL (1 hour) for reference data, medium TTL (5 minutes) for frequently changing lists, short TTL…
  5. Implement cache invalidation on mutations: when a POST/PUT/DELETE modifies a resource, invalidate all cached responses containing that…
  6. Add Cache-Control, ETag, and Last-Modified response headers for HTTP-level caching, enabling CDN and browser cache participation.
  7. Implement stale-while-revalidate behavior: serve stale cached responses immediately while asynchronously refreshing the cache in the…
  8. Add cache warming for critical endpoints: pre-populate cache entries on application startup or schedule for frequently accessed resources.
  9. Write tests verifying cache hits, misses, invalidation correctness, TTL expiration, and stale-while-revalidate behavior.

What it can do on your machine

Read from SKILL.md and the folder at commit 23ea8d4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Grep
    • Glob
    • Bash(api:cache-*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • redis.io
    • developer.mozilla.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Managing API Cache loads about 1.4k tokens when it runs, and up to ~3.3k if it reads all its reference files. Until then it costs about 63 tokens; SKILL.md has 567 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~63
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit 23ea8d4, republished under its MIT licence (© jeremylongshore). 567 words, ~1,383 tokens.

Download SKILL.mdSave it as .claude/skills/managing-api-cache/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
managing-api-cache
description
Implement intelligent API response caching with Redis, Memcached, and CDN integration. Use when optimizing API performance with caching. Trigger with phrases like "add caching", "optimize API performance", or "implement cache layer".
allowed-tools
Read, Write, Edit, Grep, Glob, Bash(api:cache-*)
compatibility
Designed for Claude Code
version
1.25.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
tags
api, redis, performance

Managing API Cache

Overview

Implement intelligent API response caching using Redis, Memcached, or in-memory stores with cache key generation, TTL management, cache invalidation strategies, and HTTP cache headers. Support read-through, write-through, and cache-aside patterns with tag-based invalidation for related resources and stale-while-revalidate behavior.

Prerequisites

  • Redis 6+ or Memcached for distributed caching (required for multi-instance deployments)
  • Cache client library: ioredis (Node.js), redis-py (Python), or Lettuce (Java)
  • CDN with cache control support for edge caching (CloudFront, Cloudflare, Fastly) -- optional
  • Monitoring for cache hit/miss ratios and eviction rates
  • Understanding of data freshness requirements per endpoint

Instructions

  1. Analyze endpoint characteristics using Read and Grep to classify endpoints by cacheability: fully cacheable (static data), conditionally cacheable (user-specific data), and never cacheable (mutations, real-time data).
  2. Implement cache key generation middleware that creates deterministic keys from method, path, query parameters (sorted), and relevant headers (Accept, Authorization hash for user-specific caches).
  3. Build a cache-aside middleware that checks the cache before executing the handler, returning cached responses with X-Cache: HIT header, or executing the handler, caching the result, and returning with X-Cache: MISS.
  4. Configure TTL per endpoint category: long TTL (1 hour) for reference data, medium TTL (5 minutes) for frequently changing lists, short TTL (30 seconds) for near-real-time data.
  5. Implement cache invalidation on mutations: when a POST/PUT/DELETE modifies a resource, invalidate all cached responses containing that resource using tag-based invalidation.
  6. Add Cache-Control, ETag, and Last-Modified response headers for HTTP-level caching, enabling CDN and browser cache participation.
  7. Implement stale-while-revalidate behavior: serve stale cached responses immediately while asynchronously refreshing the cache in the background, reducing perceived latency.
  8. Add cache warming for critical endpoints: pre-populate cache entries on application startup or schedule for frequently accessed resources.
  9. Write tests verifying cache hits, misses, invalidation correctness, TTL expiration, and stale-while-revalidate behavior.

See ${CLAUDE_SKILL_DIR}/references/implementation.md for the full implementation guide.

Output

  • ${CLAUDE_SKILL_DIR}/src/middleware/cache.js - Cache-aside middleware with hit/miss tracking
  • ${CLAUDE_SKILL_DIR}/src/cache/key-generator.js - Deterministic cache key generation
  • ${CLAUDE_SKILL_DIR}/src/cache/invalidator.js - Tag-based cache invalidation on mutations
  • ${CLAUDE_SKILL_DIR}/src/cache/store.js - Redis/Memcached cache store abstraction
  • ${CLAUDE_SKILL_DIR}/src/config/cache-policies.js - Per-endpoint TTL and caching policy configuration
  • ${CLAUDE_SKILL_DIR}/tests/cache/ - Cache behavior verification tests
Show full SKILL.md (228 more words)Show less

Error Handling

ErrorCauseSolution
Cache stampedeTTL expires simultaneously for popular key; many requests hit databaseUse lock-based revalidation (only one request refreshes); apply jittered TTLs
Stale data servedCache invalidation missed a related resource after mutationImplement tag-based invalidation covering all affected cache keys; add invalidation audit logging
Redis connection failureCache store unavailable due to network or server issueFall through to database with degraded performance; log cache bypass; alert on sustained failures
Cache key collisionDifferent requests generating identical cache keysInclude all varying parameters in key; hash the full normalized request for uniqueness
Memory pressureCache grows unbounded consuming all available Redis memoryConfigure Redis maxmemory-policy to allkeys-lru; set per-key size limits; monitor memory usage

Refer to ${CLAUDE_SKILL_DIR}/references/errors.md for comprehensive error patterns.

Examples

Product catalog caching: Cache GET /products list for 5 minutes and GET /products/:id for 1 hour, invalidating both when any product is created, updated, or deleted via tag products.

User-specific dashboard: Cache dashboard data per user using cache:dashboard:{userId} keys with 30-second TTL, serving stale data during revalidation to keep perceived response time under 50ms.

CDN edge caching: Set Cache-Control: public, max-age=300, stale-while-revalidate=60 on public endpoints, enabling CloudFront to serve cached responses at the edge while revalidating asynchronously.

See ${CLAUDE_SKILL_DIR}/references/examples.md for additional examples.

Resources

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in skills/.curated/managing-api-cache of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/errors.md
  • references/examples.md
  • references/implementation.md

Open the folder on GitHubat commit 23ea8d4

Compare with similar skills

Managing API Cache next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Managing API Cache compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Managing API Cache this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.4kAutomated safety check: PassMIT
FastAPI-Redis SDK Developmentredis/fastapi-redis-sdk404—~2.5kAutomated safety check: NotesMIT
Redis Patternsaffaan-m/ECC275k1 repos~3kAutomated safety check: PassMIT
Amazon Elasticacheaws/agent-toolkit-for-aws2.8k—~4.5kAutomated safety check: PassApache-2.0
Upstash Redissickn33/agentic-awesome-skills47k1 repos~1.5kAutomated safety check: PassMIT
Frappe Core CacheImpertio-Studio/Frappe_Claude_Skill_Package187—~2.9kAutomated safety check: PassMIT

Similar skills

  • FastAPI-Redis SDK Development

    redis/fastapi-redis-sdk

    Official

    Guides development on the fastapi-redis-sdk library itself - its connection lifecycle, dependency-injected caching, and async/sync bridging.

    404 GitHub stars~2.5k tokensUpdated 7 days ago
    Backend & APIsAuto-check: notes
  • Redis Patterns

    affaan-m/ECC

    Redis data structure patterns, caching strategies, distributed locks, rate limiting, pub/sub, and connection management for production applications.

    275k GitHub starsUsed in 1 repo~3k tokens
    Backend & APIsAuto-check passed
  • Amazon Elasticache

    aws/agent-toolkit-for-aws

    Official

    Activate when developers have latent caching needs: slow API responses, database read bottlenecks, DynamoDB throttling or cost, RDS/Aurora scaling pressure, Bedrock latency or cost, or adding a…

    2.8k GitHub stars~4.5k tokensUpdated today
    Backend & APIsAuto-check passed
  • Upstash Redis

    sickn33/agentic-awesome-skills

    Use the @upstash/redis HTTP client for caching, sessions, counters, and Redis data structures from serverless and edge runtimes without connection pooling.

    47k GitHub starsUsed in 1 repo~1.5k tokens
    Backend & APIsAuto-check passed
  • Frappe Core Cache

    Impertio-Studio/Frappe_Claude_Skill_Package

    A skill your agent uses when implementing Redis caching, cache invalidation, or distributed locking in Frappe.

    187 GitHub stars~2.9k tokensUpdated 21 days ago
    Backend & APIsAuto-check passed
  • Spring Data Redis

    rrezartprebreza/spring-boot-skills

    A skill your agent uses when implementing caching, session storage, rate limiting, or any Redis integration.

    298 GitHub stars~1.6k tokensUpdated 17 days ago
    Backend & APIsAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Analyzing Text With NLP

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to perform natural language processing and text analysis using the nlp-text-analyzer plugin.

    2.8k GitHub starsUsed in 1 repo~819 tokens
    Auto-check passed
  • Building Neural Networks

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill allows AI assistant to construct and configure neural network architectures using the neural-network-builder plugin.

    2.8k GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed
  • Detecting Data Anomalies

    jeremylongshore/tons-of-skills-marketplace

    Process identify anomalies and outliers in datasets using machine learning algorithms.

    2.8k GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check passed
  • Explaining Machine Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill enables AI assistant to provide interpretability and explainability for machine learning models.

    2.8k GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed
  • Optimizing Prompts

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill optimizes prompts for large language models (llms) to reduce token usage, lower costs, and improve performance.

    2.8k GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed

Works with

Questions about Managing API Cache

What does Managing API Cache do?

Implement intelligent API response caching with Redis, Memcached, and CDN integration. Managing API Cache is an agent skill from jeremylongshore/tons-of-skills-marketplace. Implement intelligent API response caching with Redis, Memcached, and CDN integration.

When should I use Managing API Cache?

Managing API Cache fits situations like: optimizing API performance with caching; with phrases like add caching; optimize API performance; implement cache layer.

How do I install Managing API Cache in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill managing-api-cache -a claude-code`. Or copy the skill folder (skills/.curated/managing-api-cache in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/managing-api-cache in your project. Claude Code loads it when a task matches its description.

How do I install Managing API Cache in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill managing-api-cache -a codex`. Or copy the skill folder (skills/.curated/managing-api-cache in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/managing-api-cache in your project. Codex loads it when a task matches its description.

Can I use Managing API Cache in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill managing-api-cache -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/managing-api-cache, .gemini/skills/managing-api-cache, .github/skills/managing-api-cache and .opencode/skills/managing-api-cache in your project.

What does Managing API Cache need to run?

SKILL.md names no scripts, command-line tools or credentials: Managing API Cache is instructions for the agent only. Our summary lists: Node.js. Its frontmatter pre-approves these tools: Read, Write, Edit, Grep, Glob, Bash(api:cache-*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Managing API Cache access the network?

SKILL.md names 2 domains. As links in the text: redis.io and developer.mozilla.org. This is read from the text; nothing was executed.

Is Managing API Cache safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Managing API Cache use?

Managing API Cache is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Managing API Cache use?

About 1.4k tokens (SKILL.md is roughly 5.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.9k tokens, read only when the agent opens those files.

What are the alternatives to Managing API Cache?

Skills that share tags, products or a category with Managing API Cache: FastAPI-Redis SDK Development (redis/fastapi-redis-sdk, 404 stars), Redis Patterns (affaan-m/ECC, 275k stars), Amazon Elasticache (aws/agent-toolkit-for-aws, 2.8k stars) and Upstash Redis (sickn33/agentic-awesome-skills, 47k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Managing API Cache?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,821 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 8, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.