Caching and evictionintermediate
A cache saves you from asking twice, but a cache that never forgets anything is a memory leak — so it has to know which entry to drop, and "the one nobody has touched in longest" is usually the right answer.
Search results get refetched every keystroke. Cache them — but a cache with no eviction is a memory leak with good intentions.
A key you just read survives the next eviction, and one you have not touched does not.
Published in full, before you start — every point is one of these and there is nothing else. Each one runs your code; it is not a search for keywords.
A cache saves you from asking twice, but a cache that never forgets anything is a memory leak — so it has to know which entry to drop, and "the one nobody has touched in longest" is usually the right answer.