Recipe: a bounded cache and a local rate limit
Understand small process-local examples, expiry, memory bounds, and why shared deployments need a different coordination model.
A cache reuses an earlier result; a rate limit controls how often an action is accepted. They solve different problems. Both need explicit keys, bounds, and failure behavior.
This example caps entry count and expires values on read. It uses insertion-order eviction, not a full least-recently-used algorithm. It does not bound the byte size of values, coordinate concurrent fills, or survive a process restart. Only cache small public values with a known policy.

