caching-patterns

caching-patterns is a skill for Claude Code, Codex from saajunaid/caddis-plugin. It costs 14 tokens per session (3,516 once invoked), scanned A, original, MIT.

A guide to caching data in Streamlit and FastAPI applications, two Python frameworks commonly used for interfaces and web APIs.

In plain words
What is it for?
Use it when deciding how to cache results or other data in Streamlit and FastAPI projects.
Why use it?
Caching can avoid repeating the same expensive work on every request or screen refresh.

Skill for Claude CodeCodex

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

Good fit Use it when deciding how to cache results or other data in Streamlit and FastAPI projects.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/saajunaid/caddis-plugin/caching-patterns
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 saajunaid/caddis-plugin --skill caching-patterns
Clone the repo
git clone --depth 1 https://github.com/saajunaid/caddis-plugin

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-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/saajunaid/caddis-plugin/caching-patterns/github.svg)](https://agentmods.dev/skills/saajunaid/caddis-plugin/caching-patterns)
Your own site
<a href="https://agentmods.dev/skills/saajunaid/caddis-plugin/caching-patterns"><img src="https://agentmods.dev/badge/skills/saajunaid/caddis-plugin/caching-patterns/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.

agentmods 80×15 button for caching-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/saajunaid/caddis-plugin/caching-patterns"><img src="https://agentmods.dev/badge/skills/saajunaid/caddis-plugin/caching-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 14 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,516 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.00014 $0.03516
Opus 5.5 $0.00006 $0.01406
Sonnet 5.5 $0.00003 $0.00703
Haiku 4.5 $0.00001 $0.00352

Measured 2mo ago against content hash c8847d49d9f3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

caching-patterns 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 2mo 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.

.github/skills/coding/caching-patterns/SKILL.md · 386 lines

How it starts

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

Caching Patterns

Project Context — Read project-config.md in the repo root for brand tokens, shared-library paths, and deployment targets.

When to Use

Invoke this skill when:

  • Adding caching to Streamlit data fetches
  • Caching database connections or ML models
  • Implementing multi-user caching for dashboards
  • Setting up Redis caching for FastAPI
  • Deciding cache TTL values for application data
  • Debugging stale data issues
  • Optimizing page load performance

Steps

Step 1: Choose the Right Caching Strategy

Scenario Strategy Decorator/Tool
SQL query results (DataFrames) Data cache with TTL @st.cache_data(ttl=...)
DB connections, adapters Resource cache (singleton) @st.cache_resource
ML models, LLM clients Resource cache (singleton) @st.cache_resource
Multi-user shared data Cached repository pattern Custom get_repo()
FastAPI endpoint responses Redis or in-memory redis / cachetools
Static config, lookups Long TTL or no TTL @st.cache_data

Step 2: Implement Streamlit Caching

Data Caching (returns serialized copy per caller)
from datetime import timedelta
import streamlit as st
import pandas as pd

@st.cache_data(ttl=timedelta(minutes=15), show_spinner="Loading records...")
def load_records() -> pd.DataFrame:
    """Cached data fetch -- each caller gets an independent copy."""
    from libs.data import DatabaseAdapter
    adapter = DatabaseAdapter()
    return adapter.fetch_dataframe(
        "SELECT * FROM AppRecords WHERE [Created Date Time] >= DATEADD(day, -7, GETDATE())"
    )
Resource Caching (shared singleton)
@st.cache_resource
def get_database_adapter():
    """Singleton resource -- shared across all users."""
    from libs.data import DatabaseAdapter
    return DatabaseAdapter()

@st.cache_resource
def load_ml_model():
    """Load and cache ML model."""
    import joblib
    return joblib.load("models/classifier.joblib")

Read the full file on GitHub · 386 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. 2mo ago First seen · 386 lines · 14 tokens per session scan A c8847d49d9f3

Subscribe to this mod's changes

caching-patterns is a skill published in the GitHub repository saajunaid/caddis-plugin (0 stars, last pushed 3d ago), licensed MIT. It adds 14 tokens to every session and 3,516 once invoked, about $0.0001 per session on Opus 5.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-09-03.

Related

caching-patterns compared with skills from other repositories

caching-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
caching-patternssaajunaid/caddis-pluginSkill03d agoMITA14Claude Code, Codex
agent-raft-managerruvnet/rufloSkill83ktodayMITA18Claude Code
moai-ref-api-patternsmodu-ai/moai-adkSkill1.3ktodayApache-2.0A85Claude Code
continuum-tools-mcpshyftlabs/continuumSkill863d agoApache-2.0A94Claude Code
goga-define-challengeqarium/gogaSkill468d agoBSD-3-ClauseA6Claude Code, Codex
goga-define-goalsqarium/gogaSkill468d agoBSD-3-ClauseA6Claude Code, Codex
skill-creatoreigent-ai/eigentSkill16kyesterdayApache-2.0A35Claude Code, Codex