caching

caching is a skill for Claude Code, Codex from LuuOW/meridian-mcp. It costs 29 tokens per session (1,326 once invoked), scanned A, original, MIT.

A guide to caching, Redis messaging, and queues for Python and Node services. Caching stores frequently used results temporarily so they can be returned without repeating a slower operation.

In plain words
What is it for?
Use it to add Redis or in-process caches, set time limits on cached data, invalidate entries after updates, publish messages, and build queues.
Why use it?
It helps reduce repeated database work and coordinate background jobs or messages, while showing how expiration and invalidation prevent stale results.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to add Redis or in-process caches, set time limits on cached data, invalidate entries after updates, publish messages, and build queues.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/luuow/meridian-mcp/caching
Install

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.

Any agent
npx skills add LuuOW/meridian-mcp --skill caching
Clone the repo
git clone --depth 1 https://github.com/LuuOW/meridian-mcp

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for caching

README.md
[![agentmods](https://agentmods.dev/badge/skills/luuow/meridian-mcp/caching.svg)](https://agentmods.dev/skills/luuow/meridian-mcp/caching)
Your own site
<a href="https://agentmods.dev/skills/luuow/meridian-mcp/caching"><img src="https://agentmods.dev/badge/skills/luuow/meridian-mcp/caching.svg" alt="Measured on agentmods" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,326 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00029 $0.01326
Opus 5 $0.00015 $0.00663
Sonnet 5 $0.00006 $0.00265
Haiku 4.5 $0.00003 $0.00133

Measured 8d ago against content hash a01f764bb722, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

caching scanned grade A with 0 findings 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 8d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/caching/SKILL.md · 177 lines

How it starts

The opening of the file, as written. The whole thing — 177 lines — stays where its author put it; the contents beside it link to each section on GitHub.

caching

Covers Redis as cache, pub/sub bus, and job queue — plus lightweight in-process caching for Node/Python services.

1) Redis connection (Python — async)

import redis.asyncio as aioredis

redis = aioredis.from_url(
    "redis://localhost:6379",
    encoding="utf-8",
    decode_responses=True,
    max_connections=20,
)

# Simple get/set with TTL
await redis.set("key", "value", ex=300)   # expires in 5 min
value = await redis.get("key")            # None if expired/missing

# Delete
await redis.delete("key")

2) Cache-aside pattern (Python)

import json

async def get_article(slug: str) -> dict:
    cache_key = f"article:{slug}"

    cached = await redis.get(cache_key)
    if cached:
        return json.loads(cached)

    article = await db.fetch_article(slug)        # expensive DB read
    await redis.set(cache_key, json.dumps(article), ex=3600)
    return article

# Invalidate on write
async def update_article(slug: str, data: dict):
    await db.update_article(slug, data)
    await redis.delete(f"article:{slug}")         # bust cache

3) Pub/sub (event bus between agents)

# Publisher
async def publish(channel: str, payload: dict):
    await redis.publish(channel, json.dumps(payload))

await publish("article.ready", {"slug": slug, "domain": domain})

# Subscriber (runs in background task)
async def subscribe(channel: str):
    pubsub = redis.pubsub()
    await pubsub.subscribe(channel)
    async for message in pubsub.listen():
        if message["type"] == "message":
            data = json.loads(message["data"])
            await handle_event(data)

4) Redis as job queue (simple LPUSH/BRPOP)

QUEUE = "jobs:scrape"

# Enqueue
await redis.lpush(QUEUE, json.dumps({"url": url, "domain": domain}))

# Worker — blocking pop, 30s timeout
async def worker():
    while True:
        item = await redis.brpop(QUEUE, timeout=30)
        if item:
            _, raw = item
            job = json.loads(raw)
            await process(job)

Read the full file on GitHub · 177 lines

Changes

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.

  1. 8d ago First seen · 177 lines · 29 tokens per session scan A a01f764bb722

Subscribe to this mod's changes

caching is a skill published in the GitHub repository LuuOW/meridian-mcp (0 stars, last pushed 4d ago), licensed MIT. It adds 29 tokens to every session and 1,326 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

cache-strategy-invalidation-expert

Redis caching patterns, cache-aside, write-through, TTL strategies, and invalidation. Activate on: caching, Redis, cache invalidation, cache-aside, write-through, TTL, CDN cache, stale-while-revalidate. NOT for: CDN/reverse proxy setup (use api-gateway-reverse-proxy-expert), database query optimization (use…

curiositech/windags-skills · 86 tokens

caching

Caching strategies — invalidation, TTL guidelines, cache keys, cache layers, and when not to cache. Use when implementing or reviewing caching logic.

zebbern/termstack · 32 tokens

redis-state-management

Comprehensive guide for Redis state management including caching strategies, session management, pub/sub patterns, distributed locks, and data structures.

manutej/luxor-claude-marketplace · 28 tokens

caching-strategies

Design multi-tier caching architectures for web applications — cache-aside vs write-through vs write-behind, TTL design, cache invalidation, Redis patterns, CDN configuration, browser caching, and stampede prevention. Use when choosing a caching pattern, designing cache invalidation strategies, implementing Redis…

curiositech/windags-skills · 137 tokens

azure-cosmos-db-py

Build Azure Cosmos DB NoSQL services with Python/FastAPI following production-grade patterns. Use when implementing database client setup with dual auth (DefaultAzureCredential + emulator), service...

benjaminasterA/antigravity-awesome-skills · 42 tokens

azure-cosmos-py

Client library for Azure Cosmos DB NoSQL API — globally distributed, multi-model database.

benjaminasterA/antigravity-awesome-skills · 0 tokens