You added a cache for user profiles. Now users say their profile looks unchanged right after they edit it. Most likely cause?
- The database is losing writes under load
- The cache isn't invalidated when the profile changes
- The load balancer sends reads to a slow server
- The browser renders the profile before the write finishes
Show answer
Answer: B. The cache isn't invalidated when the profile changes
Reads hit the old cached copy until it expires. On write, delete (or update) the cache entry. Deleting is usually safer than updating, because two concurrent updates can leave the cache holding the older value.