Skip to content

Conversation

@gcloudream
Copy link

Summary:
Add optional TTL jitter and probabilistic early expiration to reduce cache stampede (#91).

Problem:
Expiration scheduling is deterministic; entries created at the same time with the same TTL expire together, causing a thundering herd.

Fix:
Add Builder.expirationJitter(jitterPercent) to randomize per-entry TTL on reset.
Add Builder.probabilisticExpiration(probability, windowPercent) to expire early on access when within the last window of TTL.
Both features are opt-in; defaults preserve current behavior.

Tests:
Issue91#testProbabilisticEarlyExpiration
Issue91#testExpirationJitterWithinBounds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant