A cache keeps answers that were expensive to get, so that asking again is cheap. But memory is limited, and old answers go stale, so a cache needs rules: what to throw out when it is full, and how long an answer may live. This project builds a cache with least-recently-used eviction and an expiry time, with statistics, and a decorator that puts it in front of a function. A clock that you control makes the time rules testable.
More lessons in Complete Python Programming