How do you configure deletion policies in Redis?

In Redis, deletion policies can be configured through parameters, and there are several specific deletion policies available.

  1. no removal from property
  2. unpredictable least recently used
  3. unpredictable time to live
  4. unpredictable-random
  5. least recently used keys
  6. randomly generated keys
  7. fickle-least frequently used
  8. Least frequently used of all keys

The default eviction policy is noeviction, and it can be configured in the Redis configuration file redis.conf by setting the maxmemory-policy parameter. For example, the configuration set to volatile-lru is as follows:

maxmemory-policy volatile-lru
bannerAds