Putting Tasks in a Cache, and Computing Only Once, When First Requested

I wrote another the version of the code using Lazy<Task > as suggested by Stephen Cleary in a comment on different post. Most of the time when I cache a value it is something that I pull from a slower data source like a database or an API. Other times the value to store is something that takes significant work to compute, so I don&rsquo;t want to recompute it each time it is requested. Normally…