A cache may become full, in which case the caching system must know which items it can discard in order to make room for new data. The following are some of the policies that can be used to evict data:
- Least recently used (LRU): Based on the assumption that cached items that have recently been used are the most likely to be used again soon, this discards items that were least recently used first.
- Most recently used (MRU): Based on the assumption that cached items that have been recently used will not be needed again, this discards items that were most recently used first.
- First-in, first-out (FIFO): Like a FIFO queue, this discards the item that was placed in the cache first (oldest data). It does not take into consideration ...