Skip to main content

design-a-cache-invalidation-strategy

Design cache invalidation from data authority, key identity, dependency, freshness, event ordering, failure, and repair requirements. Use when cached values can become stale across processes or regions.

소스 정보

저장소
protosphinx/sphinxstack
최근 소스 활동
2026년 7월 29일 13:55
감지된 SKILL.md 언어
영어
스타
3
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
design-a-cache-invalidation-strategy
category
code
description
Design cache invalidation from data authority, key identity, dependency, freshness, event ordering, failure, and repair requirements. Use when cached values can become stale across processes or regions.
# design-a-cache-invalidation-strategy Define what makes a cached value equivalent before choosing eviction. ## When to use - Use for application, CDN, query, object, computed, or distributed caches. - Do not cache authorization or sensitive data without explicit correctness and isolation controls. ## Preconditions - Define authoritative data, readers, writers, keys, dependencies, freshness, regions, load, privacy, and failure tolerance. ## Procedure 1. Define each cache entry’s identity, scope, version, derivation, and acceptable staleness. 2. Map writes and dependencies that can invalidate or supersede it. 3. Choose versioned keys, write-through, event invalidation, revalidation, TTL, or a justified combination. 4. Prevent cross-tenant collision and old events from evicting or repopulating new generations. 5. Handle stampede, negative caching, partial failure, partitions, clock skew, and cold start. 6. Add bypass, purge, generation advance, and rebuild controls. 7. Measure hit rate alongside stale-read and origin-load evidence. 8. Test mutation races, reorder, duplication, outage, recovery, and privacy boundaries. ## Failure plan - Bypass or advance generation when cache correctness is uncertain and protect the origin with bounded load controls. ## Worked example A product page key includes catalog generation and locale; stale invalidation events cannot overwrite a newer generation. ## Done - A cache strategy document records authority, identity, dependencies, freshness, invalidation, isolation, repair, and observability - Race, stale-event, tenant, partition, stampede, bypass, purge, and origin-recovery tests verify correctness
GitHub에서 보기