FIFO cache vs LRU cache

You are correct.

Think of FIFO as cars going through a tunnel. The first car to go in the tunnel will be the first one to go out the other side.

Think of the LRU cache as cleaning out the garage. You will throw away items that you have not used for a long time, and keep the ones that you use frequently. An evolution of that algorithm (an improvement to simple LRU) would be to throw away items that have not been used for a long time, and are not expensive to replace if you need them after all.


Yes, LRU cache is based on least recent use of on object in cache but FIFO is based on the time an object is cached.