Eviction Strategies
- Least Recently Used
- Least Frequently Used
- Most Recently Used
- Random
- Time to Live
Use Cases
| Invalidation Strategy | Use Case | Additional Notes |
|---|
| LRU | Predictable usage patterns; expect users to frequent same data | Most popular |
| LFU | Predictable usage patterns; some data is more regularly accessed that others | |
| MRU | Data becomes stale quickly | |
| RR | No distillable usage patterns; data changes quickly such that caching is less valuable | |
| TTL | Time sensitive nature of data’s staleness | |
Best Practices
- Set an optimal size limit for cache
- Monitor; cache hit/miss ratio
- Tune eviction strategies
Invalidation Strategies
- Write requests invalidate data
- Event-driven; based on user, domain or system actions
- Manual control