# Cache Skill

> describe how to write cache related code in the codebase, use when you need to add or modify cache related code or user ask to optimize the cache related code to the codebase Use when this capability is needed.

- Skill: `tomevault-io/cache-skill` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/cache-skill`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/cache-skill/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/cache-skill

---


# cache best practices
the document outlines the best practices for writing cache related code in the codebase.

## when to use this skill
when you need to add or modify cache related code or user ask to optimize the cache related code to the codebase

## best practices
+ you should always try to use transaction within cache operation whenever possible to ensure data consistency, and rollback the transaction if the operation failed
+ you should separate different cache value into different database to have better maintainability, don't put all the cache value into the same database
+ you should always try to use cache eviction policy to ensure the cache value is always up to date
+ you should always try to use sorted set instead of list to store ordered data
+ you should try to use cuckoo filter when you need fast lookup if data present or not

---
> Source: [ambersun1234/skills](https://github.com/ambersun1234/skills) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-03 -->

