Frequent questions about cache invalidation: TTL vs explicit, thundering herd, and purge-by-tag mechanics.
- Cache invalidation vs general invalidation?
This entry covers cache specifically. Sessions, tokens, plans and permissions have their own invalidation mechanisms.
- TTL vs explicit invalidation?
TTL is simple and safe; explicit is precise and complex. Use TTL for public content, explicit for user-specific data.
- What is a thundering herd?
When a popular cache key expires, N requests try to refill it at once, hitting the origin simultaneously. Fix with locks or jitter.
- Can I avoid invalidation entirely?
Yes, for static assets: version the URL.
/app.v43.jsis a new resource; the old one is never requested again.