You manage an Azure Cache for Redis instance that stores session data and reference tables. The session keys are configured with an expiration time, while the reference tables must remain in the cache indefinitely and do not have an expiration time. Due to an unexpected surge in traffic, the cache is reaching its memory limit. You need to configure a policy that removes keys with an expiration time, prioritizing those closest to expiring, while ensuring the reference tables are not removed. Which maxmemory policy should you configure?
- Aallkeys-lru
- volatile-ttlCevap
- Cvolatile-random
- Dnoeviction
Cevap
volatile-ttl
The volatile-ttl policy evicts keys with an expiration time (TTL) set, prioritizing those with the shortest remaining time-to-live. Since the reference tables do not have an expiration time, they are protected from eviction under this policy.
Adım Adım Çözüm
Anahtar Kavram
Azure Cache for Redis maxmemory eviction policies