In the standard library, the @functools.cache and @functools.cached_property function and method decorators do LRU caching in RAM only. https://docs.python.org/3/library/functools.html
Dask docs > "Automatic Opportunistic Caching": https://docs.dask.org/en/stable/caching.html#automatic-oppor... ; dask.cache.Cache(size_bytes:int) ... "Cache tasks, not expressions"
Pickles are not a safe way to deserialize data; there is not a data only pickling protocol.
So caching arbitrary cell objects (or e.g. stack frames) to disk, as pickles at least, creates risk of code injection if the serialized data contains executable code objects.
Similarly, the file permissions on e.g. rr traces. https://en.wikipedia.org/wiki/Rr_(debugging)
Dataclasses in the standard library helps with object serialization, but not with caching cell outputs containing code objects.
Apache Arrow and Parquet also require schema for efficient serialization.
LRU: Least-Recently Used
MRU: Most-Recently Used; most frequently accessed
Out-of-order execution in notebooks may or may not have wasted cycles of human time and CPU time. If the prompt numbers aren't sequential, what you ran in a notebook is not necessarily what others will get when running that computation graph in order; and so it's best practice to "Restart and Run All" to test the actual control flow before committing or pushing.
There are ways to run and test notebooks in order on or before git commit (and compare their output with the output from the previous run) like software with tests.