Need Assistance?

support@tutorialshub.in

Expiration, TTL & Eviction Policies

maxmemory & Eviction Policies (LRU vs LFU)

ADVERTISEMENT
Redis Free Lesson
5 min read
ADVERTISEMENT

When Redis is used as a cache and RAM fills up, configure maxmemory and an eviction policy:

  • allkeys-lru: Evicts Least Recently Used keys across all keys (best for general caching!).
  • allkeys-lfu: Evicts Least Frequently Used keys.
  • volatile-lru: Evicts LRU keys only among keys that have a TTL set.
  • noeviction: Returns errors on writes when full (default; use when Redis is a primary queue/store, not a cache).
ADVERTISEMENT
Hi, I'm Tuby! Here to help you