Agent skill · Backend & API

gemini-api-caching

Best practices for Gemini API caching strategy including cache versioning, entity-stable keys, and cache busting for WescoBar

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
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.

Facts
Files in the skill folder: 2
SKILL.md size: 9 KB
Bundled scripts: none
Path: skills/ai-llm/caching-berrykuipers-claude-code-toolkit-2/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 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

What's inside
Steps it walks through
  1. Purpose
  2. When to Use
  3. Caching Strategy
  4. 1. Cache Versioning
  5. 2. Entity-Stable Keys
  6. 3. Cache Busting
  7. Instructions
  8. Step 1: Define Cache Version
  9. Step 2: Use Entity-Stable Keys
  10. Step 3: Implement Cache Read
  11. Step 4: Implement Cache Write
  12. Step 5: Implement Cache Busting
  13. Step 6: Handle Cache Expiration (Optional)
  14. Integration Patterns
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
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.

Keep going