"A hundred identical requests at once should cost exactly one paid call. The other ninety-nine wait for it."
The Burst Problem
A content-addressed cache stops you from paying twice in sequence: the second request, later, is a hit. But what about ten identical requests arriving in the same instant, before any of them has finished and populated the cache? A naive engine lets all ten see a cache miss and all ten make a paid call — ten charges for one piece of audio. This is the classic thundering-herd, and money makes it sting.
Single-Flight on the Identity
Bellows guarantees one cache identity has at most one in-process paid synthesis at a time. The first request to miss the cache starts the paid call and registers itself as in-flight for that identity; every other request with the same identity attaches to the same in-flight call and awaits its result instead of starting its own. One payer, many riders. When it completes, the cache is populated and the identity is cleared for next time.
Scope the Lock to the Key, Not the Engine
The subtlety is granularity. You don't want a single global lock that serializes all synthesis — that would make ten different sentences queue behind each other for no reason. The lock is per-identity: different identities run fully in parallel, and only identical ones collapse onto a single call. The key you built in the last lesson is exactly the right lock name.