gemini-api-caching
Best practices for Gemini API caching strategy including cache versioning, entity-stable keys, and cache busting for WescoBar
npx skills add majiayu000/claude-skill-registry --skill caching-berrykuipers-claude-code-toolkit-2 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Gemini API Caching ## Purpose Implement robust caching strategies for Gemini API calls to reduce cost, improve latency, and provide better user experience while supporting cache invalidation when needed. ## When to Use - Implementing any Gemini API feature - Generating character portraits or world images - Caching AI-generated content - Reducing API quota usage - Improving app performance ## Caching Strategy From AGENTS.md Section 3: "A robust, multi-layered local storage cache" ### 1. Cache Versioning ### 2. Entity-Stable Keys ### 3. Cache Busting ## Instructions ### Step 1: Define Cache Version ```typescript // Global cache version constant const CACHE_VERSION = 'v2'; // Prepend to all cache keys const getCacheKey = (entity: string, id: string) => { return `${CACHE_VERSION}-${entity}:${id}`; }; // Example const portraitKey = getCacheKey('character-portrait', 'core-pablo'); // Result: "v2-character-portrait:core-pablo" ``` **Purpose**: Instant global cache invalidation by bumping version **When to bump**: - Prompt template changes - Image generation model updates - Quality improvements needed - Global regeneration required ### Step 2: Use Entity-Stable Keys ```typescript // ✅ CO
- Purpose
- When to Use
- Caching Strategy
- 1. Cache Versioning
- 2. Entity-Stable Keys
- 3. Cache Busting
- Instructions
- Step 1: Define Cache Version
- Step 2: Use Entity-Stable Keys
- Step 3: Implement Cache Read
- Step 4: Implement Cache Write
- Step 5: Implement Cache Busting
- Step 6: Handle Cache Expiration (Optional)
- Integration Patterns
What does the gemini-api-caching skill do?
Best practices for Gemini API caching strategy including cache versioning, entity-stable keys, and cache busting for WescoBar
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill caching-berrykuipers-claude-code-toolkit-2 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
