Image for LRU Cache

LRU Cache

An LRU (Least Recently Used) Cache is a way for systems to quickly access frequently used data while discarding the oldest or least accessed information when space runs out. Think of it like a short-term storage that keeps the most recent or relevant items at the top, ensuring quick retrieval. When new data arrives and the cache is full, it removes the item that hasn't been used for the longest time. This approach optimizes performance by maintaining quick access to recent data while managing limited storage efficiently.