Barebones model of Spotify's 'Recently Played' screen using a Least Recently Used (LRU) cache in Golang

One of the most used caching schemes is Least Recently Used (LRU). Caches that use this eviction strategy will remove the least recently used item when their size reaches their capacity. That means that such caches have to keep a track of the order of access of the cached items, so it would evict the correct items. Before we go too much into details about the implementation of an LRU cache, let’s first see what are the possible applications of this caching scheme....

March 11, 2019 · 13 min · Ilija