cachex-caching
Installation
SKILL.md
Cachex Caching
RULES — Follow these with no exceptions
- Set TTL on every cached entry — never cache indefinitely unless data is truly immutable
- Use
Cachex.fetch/3for get-or-set — never check-then-set (race condition risk) - Invalidate on writes — call
Cachex.del/2after any data mutation - Enable stats: true — without stats you cannot measure cache effectiveness
- Use cache warmers for startup — pre-populate expensive data when application starts
- Handle cache failures gracefully — fall back to database on cache errors
End-to-End Workflow
Follow this sequence when adding caching to a feature: