Q11 Redis Domain 2 · 25–30% of exam

Cached product prices in Azure Managed Redis must expire after five minutes, and must disappear immediately when a price changes. What should you do?

  1. A Set a 300-second TTL on each key and delete the key when its price is updated (correct answer)
  2. B Rely on the maxmemory eviction policy
  3. C Refresh the whole cache from a scheduled job every five minutes
  4. D Store prices without a TTL and flush the cache once a day

Shortcut: Fresh Redis data = TTL for expiry + delete the key on update. Eviction only happens under memory pressure, and scheduled refreshes or daily flushes leave stale prices in the cache.

A TTL (for example SET with EX 300) removes stale entries automatically, and deleting the key when the price changes invalidates it at once; the next read reloads it from the database (cache-aside). Eviction only happens under memory pressure, and scheduled refreshes or daily flushes leave stale prices in the cache.