key
Cache key
- Can be any string
ttl
Max cache time
- In seconds
- Set this to
false
to debug the callback function and prevent caching
- Callback function
- Async
- The return value will be cached
A promise. The callback function's return value. If the value has already been cached, it will return that. If the value has not been cached, it will run and await the callback function, set the cache, and return the value.