# LRU vs LFU in depth

> How do LRU and LFU eviction work in Redis, and when would you prefer LFU over LRU?

Canonical: https://www.internhack.in/learn/interview/redis-caching/redis-eviction-lru-vs-lfu
Last updated: 2026-11-28

Difficulty: Intermediate

## Question

How do LRU and LFU eviction work in Redis, and when would you prefer LFU over LRU?

*The full answer is for InternHack members. Open the page link above to read it.*

## Concepts covered

maxmemory-policy, Approximated LRU, LFU Counter, lfu-decay-time, Hot Keys

Previous: [Redis Streams](https://www.internhack.in/learn/interview/redis-caching/redis-streams-vs-kafka) · Next: [Lua Scripting](https://www.internhack.in/learn/interview/redis-caching/redis-lua-scripting) · [All of Redis & Caching](https://www.internhack.in/learn/interview/redis-caching)

## More Redis & Caching questions

- [Replication: Master-Slave](https://www.internhack.in/learn/interview/redis-caching/redis-replication-basics)
- [Memory Optimization](https://www.internhack.in/learn/interview/redis-caching/redis-internal-memory-optimization)
- [Redis Bitmaps](https://www.internhack.in/learn/interview/redis-caching/redis-bitmaps-use-case)
- [HyperLogLog](https://www.internhack.in/learn/interview/redis-caching/redis-hyperloglog)
- [Setting Expiry](https://www.internhack.in/learn/interview/redis-caching/redis-ttl-command)
- [Redis Info](https://www.internhack.in/learn/interview/redis-caching/redis-info-command)

## Related

- [Learn](https://www.internhack.in/learn)
- [Interview Prep](https://www.internhack.in/learn/interview)
- [Redis & Caching](https://www.internhack.in/learn/interview/redis-caching)
