microwind/ai-skills/cache-invalidation
Claude Code and agent skill by microwind/ai-skills
Trust tier 2
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
当设计缓存失效时,分析失效模式,优化数据一致性,解决缓存雪崩。验证缓存架构,设计失效策略,和最佳实践。
Install
npx vskill@latest install microwind/ai-skills/cache-invalidationSKILL.md
缓存失效策略技能
概述
缓存失效是缓存系统中的关键问题,决定了数据的一致性和系统的可用性。不当的失效策略会导致数据不一致、缓存雪崩、性能下降。选择合适的失效策略对系统性能和数据一致性至关重要。
核心原则: 好的失效策略应该保证数据一致性、避免缓存雪崩、提高命中率、减少性能影响。坏的失效策略会导致数据不一致或系统不稳定。
何时使用
始终:
- 设计缓存系统时
- 处理数据一致性时
- 优化缓存性能时
- 解决缓存雪崩时
- 实现分布式缓存时
- 处理热点数据时
触发短语:
- "如何设计缓存失效?"
- "缓存一致性问题"
- "避免缓存雪崩"
- "缓存失效策略选择"
- "分布式缓存失效"
- "热点数据处理"
缓存失效策略技能功能
失效模式
- 主动失效
- 被动失效
- 定时失效
- 版本失效
- 事件驱动失效
一致性保证
- 强一致性
- 最终一致性
- 写入失效
- 读取失效
- 双写一致性
性能优化
- 批量失效
- 异步失效
- 分级失效
- 预热策略
- 防雪崩机制
监控管理
- 命中率监控
- 失效率统计
- 性能指标
- 告警机制
- 容量规划
常见问题
一致性问题
- 问题: 缓存与数据库不一致
- 原因: 失效策略不当,并发更新
- 解决: 使用合适的失效策略,保证一致性
- 问题: 分布式缓存不一致
- 原因: 网络延迟,失效传播失败
- 解决: 使用分布式失效机制
性能问题
- 问题: 缓存雪崩
- 原因: 大量缓存同时失效
- 解决: 使用随机过期时间,错峰失效
- 问题: 缓存穿透
- 原因: 查询不存在的数据
- 解决: 缓存空值,使用布隆过滤器
可用性问题
- 问题: 缓存故障影响系统
- 原因: 过度依赖缓存
- 解决: 降级策略,熔断机制
代码示例
基础缓存失效实现
Redis分布式缓存失效
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsystem-design/cache-invalidation/SKILL.md
Popularity
- Repository stars
- 51
- Repository forks
- 13
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microwind/ai-skills/cache-invalidation)