⚠️ Warning: Don't cache lazy IEnumerable<T> in .NET
(The same is true for IAsyncEnumerable<T>)
A few days ago I came across a code where a developer used .NET MemoryCache to cache data retrieved from the database. Sounds boring, but... every time the cache needed to return a result, a call to the data...
zagosk.in2 min read