home / skills / harborgrid-justin / lexiflow-premium / resource-cache-invalidation
/frontend/.github-skills/resource-cache-invalidation
This skill helps optimize resource caching with precise invalidation for dynamic data, providing multi-tier caches, versioned keys, and dependency-based
npx playbooks add skill harborgrid-justin/lexiflow-premium --skill resource-cache-invalidationReview the files below or copy the command above to add this skill to your agents.
---
name: resource-cache-invalidation
description: Implement advanced caching with precise invalidation for highly dynamic data domains.
---
# Resource Cache Invalidation (React 18)
## Summary
Implement advanced caching with precise invalidation for highly dynamic data domains.
## Key Capabilities
- Design multi-tier caches (in-memory + persisted) with TTL policies.
- Implement versioned cache keys to prevent stale hydration.
- Use dependency-based invalidation with minimal recomputation.
## PhD-Level Challenges
- Formally reason about cache staleness windows and correctness.
- Analyze invalidation cascades in high-churn data graphs.
- Derive optimal TTL under changing network conditions.
## Acceptance Criteria
- Provide cache hit-rate analysis before/after improvements.
- Demonstrate deterministic cache invalidation behavior.
- Document consistency guarantees and failure modes.
This skill implements advanced caching strategies with precise invalidation tailored for highly dynamic data domains. It combines multi-tier caches, versioned keys, and dependency-aware invalidation to reduce stale reads while preserving determinism and observability. The outcome is measurable hit-rate improvements and predictable consistency behavior.
The skill layers an in-memory fast cache with a persisted backing store and applies configurable TTLs per tier. Cache entries include versioned keys and dependency metadata so updates trigger minimal, targeted invalidations rather than broad clears. Analytics capture hit/miss patterns and staleness windows to guide TTL tuning and prove deterministic invalidation.
How does versioned keying help avoid stale hydration?
Versioned keys encode schema or format changes so older cached payloads are never used after a version bump, forcing safe rehydration or recompute.
What metrics prove improvement?
Compare hit-rate, average read latency, and measured staleness window before and after changes; also track invalidation cascade size and frequency.