intermediateDesign Patterns~55 min
Caching Proxy (Proxy Pattern)
A slow service, and a stand-in that speaks its exact language. The Proxy pattern puts an object in front of the real one, sharing its interface so callers never know the difference — while it quietly adds superpowers. Build a proxy that delegates, then caches results, then defers construction until first use, then guards access, then invalidates stale entries. Same fetch(key) throughout; the real service never changes.