I couldn't work out another way to sensibly use `Memory.cache` to perform this operation. In particular, I do not want the pipeline object itself to be part of the cache key. I considered an approach that uses `Memory.cache`'s `ignore` argument, but I can't remember why I decided against it.

If you have a neat alternative, let me know. But this code is currently intended only as a prototype of the functionality.