Reputation: 29326
I'm using Redis with a allkeys-lfu
set in configuration for eviction.
However there's one key that I want to make sure is never evicted, can I manually set a "protect" on that key so it will never be evicted under any circumstance, even if it's almost never used?
Upvotes: 0
Views: 625
Reputation: 50112
Nope, you'll need to solve this by setting the policy to one of the volatile-*
policies, and set an arbitrarily large TTL on all keys except the one you want "protected".
That said, most often than not, it is simpler to use two dedicated databases, each configured per the requirements for the dataset that it stores.
Upvotes: 1