In general, the LRU cache should only be used when you want to reuse
previously computed values. Accordingly, it doesn't make sense to cache
- functions with side-effects, functions that need to create distinct mutable
- objects on each call, or impure functions such as time() or random().
+ functions with side-effects, functions that need to create
+ distinct mutable objects on each call (such as generators and async functions),
+ or impure functions such as time() or random().
Example of an LRU cache for static web content::