using `with CacheContext()` for memoize_with_context too so that we can support nested calls