Creates a middleware factory that caches the return value of the wrapped
function using the provided ICache instance.
The cache key is derived from the wrapped function's arguments via the
key setting. If the key is already present in the cache the cached value
is returned immediately; otherwise the wrapped function is invoked and its
result is stored before being returned.
Creates a middleware factory that caches the return value of the wrapped function using the provided ICache instance.
The cache key is derived from the wrapped function's arguments via the
keysetting. If the key is already present in the cache the cached value is returned immediately; otherwise the wrapped function is invoked and its result is stored before being returned.