.NET Architecture & System Design Interview Question #33

What is cache eviction?

Caching, CDN, Queues & Asynchronous Processing Junior Beginner

Quick Interview Answer

Cache eviction removes entries to free space or because entries are expired or no longer useful. Eviction may be triggered by expiration, explicit invalidation, memory pressure, or a cache replacement policy.

Detailed Explanation

Cache eviction removes entries to free space or because entries are expired or no longer useful. Eviction may be triggered by expiration, explicit invalidation, memory pressure, or a cache replacement policy.

Applications should not assume cached data will always exist. Correct behavior must still be possible after eviction by reloading or recomputing the value.

Code Example

Cache entry removed
      |
next request
      |
cache miss
      |
reload from source