generic-cache-eviction

Implement clock-safe TTR-based in-memory cache eviction with jitter.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/Puzzle9900/puzzle9900-claude-plugin --skill generic-cache-eviction
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: generic-cache-eviction
Source: https://github.com/Puzzle9900/puzzle9900-claude-plugin/tree/main/skills/generic-cache-eviction
Command: npx skills add https://github.com/Puzzle9900/puzzle9900-claude-plugin --skill generic-cache-eviction

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures that in-memory caches reliably evict old data using a time-to-refresh (TTR) strategy that is safe against clock adjustments.

Core Features & Use Cases

  • Clock-Safe Eviction: Prevents data staleness even if system clocks change unexpectedly.
  • Jitter Implementation: Avoids thundering herd problems by staggering cache refreshes.
  • Use Case: When building a feature that caches frequently accessed user profiles, this skill guides you to implement an eviction policy that ensures users always see up-to-date information without overwhelming your backend services.

Quick Start

Guide me through implementing clock-safe cache eviction for a new in-memory cache.

Frequently Asked Questions about generic-cache-eviction

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement in-memory cache eviction that is safe against system clock adjustments?

To implement clock-safe cache eviction, use absolute value comparisons for expiry checks and carefully handle time sources to enforce a consistent time-to-refresh (TTR) strategy, preventing data staleness even if system clocks change unexpectedly.

What causes thundering herd issues in cache expiration and how do I prevent them?

Thundering herd issues in cache expiration occur when multiple cache entries expire simultaneously, overwhelming backend services. You prevent them by implementing jitter, which staggers cache refreshes across different time intervals to distribute the load evenly.

How do I add jitter to a TTR-based cache eviction policy?

You add jitter to a TTR-based cache eviction policy by staggering cache refresh times, preventing simultaneous expiration of multiple entries. This technique distributes refresh operations over time, avoiding sudden spikes in backend service requests.

Does this clock-safe TTR eviction strategy work across different platforms?

Yes, this TTR-based in-memory cache eviction strategy is applicable across all platforms. It relies on absolute value comparisons for expiry checks and platform-agnostic jitter implementation to ensure consistent cache behavior regardless of the environment.

When should I use a TTR-based eviction policy for my in-memory cache?

You should use a TTR-based eviction policy for in-memory caches when you need to ensure users always see up-to-date information, such as caching frequently accessed user profiles, without overwhelming your backend services with simultaneous refresh requests.