Sponsor Suno AI Music arrow_forward
Slash Command

Implement Caching

Implement comprehensive multi-level API caching strategies with Redis, CDN,

Type
Slash Command
GitHub stars
2.8k
License
MIT
Repo last updated
Sep 27, 2026
Version
2.0.0

What Implement Caching is

Implement Caching is a slash command published in the jeremylongshore/tons-of-skills-marketplace repository on GitHub, which has about 2.8k stars. 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.”

A slash command is a reusable prompt saved as a markdown file and run by typing its name after a slash. In Claude Code, custom commands have been merged into skills: a file in .claude/commands/ and a skill folder in .claude/skills/ both create the same kind of command, and existing command files keep working.

Implement Caching gives you a repeatable way to run the same instructions without retyping them, optionally with arguments.

How to install Implement Caching

Claude Code

  1. Download implement-caching.md from the repository.
  2. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md.
  3. Run it by typing / followed by its name.

Claude Cowork

  1. Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it.
  2. In Customize → Skills, click +, then upload the ZIP.
  3. Run it from any task with / and the skill name.

New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.

Inside the source file

An excerpt from plugins/api-development/api-cache-manager/commands/implement-caching.md, shared under the repository's MIT license. Read the full file on GitHub.

Creates comprehensive multi-level caching strategies to dramatically improve API performance, reduce database load, and enhance user experience. Implements Redis for server-side caching, CDN integration for edge caching, and proper HTTP cache headers for client-side optimization.

When to Use

Use this command when:

  • API response times exceed acceptable thresholds (>200ms)
  • Database queries are repetitive and expensive
  • Static or semi-static content dominates API responses
  • High traffic causes server strain and increased costs
  • Geographic distribution requires edge caching
  • Rate limiting needs efficient request counting
  • Session data requires fast access across servers

Do NOT use this command for:

  • Real-time data that changes every request
  • User-specific sensitive data (without proper cache isolation)
  • APIs with complex invalidation dependencies
  • Small-scale applications where caching adds unnecessary complexity

Prerequisites

Before running this command, ensure:

  • API endpoints are identified and categorized by cache lifetime
  • Redis or Memcached is available (or can be provisioned)
  • CDN service is configured (CloudFlare, Fastly, or AWS CloudFront)
  • Cache key strategy is defined
  • Monitoring tools are ready to track cache performance

Process

Step 1: Analyze API Patterns

The command examines your API to determine optimal caching strategies:

  • Identifies read-heavy endpoints suitable for caching
  • Categorizes data by volatility (static, semi-dynamic, dynamic)
  • Analyzes request patterns and frequency
  • Determines appropriate cache TTL values
  • Maps data dependencies for invalidation

Step 2: Implement Server-Side Caching

Sets up Redis-based caching with intelligent patterns:

  • Cache-aside pattern for on-demand caching
  • Write-through for immediate cache updates
  • Write-behind for asynchronous cache population
  • Distributed caching for horizontal scaling
  • Cache warming for critical data

Step 3: Configure HTTP Cache Headers

Implements proper HTTP caching directives:

  • Cache-Control headers with appropriate max-age
  • ETag generation for conditional requests
  • Vary headers for content negotiation
  • Surrogate-Control for CDN-specific behavior
  • Stale-while-revalidate for improved perceived performance

Step 4: Integrate CDN Caching

Configures edge caching for global distribution:

  • Cache rules based on URL patterns
  • Geographic cache distribution
  • Cache purging API integration
  • Origin shield configuration
  • Custom cache keys for variants

Step 5: Implement Cache Invalidation

Creates sophisticated invalidation strategies:

  • Tag-based invalidation for related content
  • Event-driven cache clearing
  • Time-based expiration with jitter
  • Cascade invalidation for dependent data
  • Soft purging with grace periods

Output Format

The command generates a complete caching implementation:

api-caching/
├── src/
│   ├── cache/
│   │   ├── redis-client.js
│   │   ├── cache-middleware.js
│   │   ├── cache-strategies.js
│   │   └── invalidation-service.js
│   ├── middleware/
│   │   ├── http-cache-headers.js
│   │   └── cdn-integration.js
│   └── utils/
│       ├── cache-key-generator.js
│       └── cache-metrics.js
├── config/
│   ├── cache-config.json
│   ├── redis.config.js
│   └── cdn-rules.json
├── tests/
…

Examples

Example 1: E-commerce Product API with Redis

Scenario: High-traffic product catalog requiring sub-100ms response times

Generated Redis Implementation:

// cache/redis-client.js
import Redis from 'ioredis';
import { promisify } from 'util';

class CacheManager {
  constructor() {
    this.client = new Redis({
      host: process.env.REDIS_HOST,
      port: process.env.REDIS_PORT,
      password: process.env.REDIS_PASSWORD,
      retryStrategy: (times) => Math.min(times * 50, 2000),
      enableOfflineQueue: false
    });

    this.defaultTTL = 3600; // 1 hour default
    this.client.on('error', this.handleError);
  }
…

Example 2: CDN Integration with Cache Purging

Scenario: Global content delivery with CloudFlare integration

Generated CDN Configuration:

// cdn-integration.js
class CDNManager {
  constructor(config) {
    this.zoneId = config.cloudflareZoneId;
    this.apiToken = config.cloudflareApiToken;
    this.baseUrl = 'https://api.cloudflare.com/client/v4';
  }

  // Set CDN cache headers
  setCacheHeaders(res, options = {}) {
    const {
      maxAge = 3600,
      sMaxAge = 86400,
      staleWhileRevalidate = 60,
      staleIfError = 3600,
      mustRevalidate = false,
      public = true
    } = options;
…

Before you install

  • Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
  • Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
  • Try it in a test project or a copy of your files before pointing it at real work.
  • Pin the version you tested, and review changes before updating.
  • Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.

FAQ

What is Implement Caching?

Implement Caching is a slash command for Claude Code and Claude Cowork from the jeremylongshore/tons-of-skills-marketplace repository on GitHub. Implement comprehensive multi-level API caching strategies with Redis, CDN,

How do I install Implement Caching in Claude Code?

Download implement-caching.md from the repository. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md. Run it by typing / followed by its name.

Can I use Implement Caching in Claude Cowork?

Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it. In Customize → Skills, click +, then upload the ZIP. Run it from any task with / and the skill name.

Is Implement Caching safe to install?

It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.

Similar resources

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.