Last tested: Apr 29, 2020
These are the three locations where we'll store the cached values.
- Memory cache: the RAM of the local node
- Local cache: the disk of the local node
- Remote cache: the disk of a different node of the cluster
For a better explained context, a cached object can live in the process memory or as a file on disk or - in the case of a cluster- on a node that's remote to the current process, but it all refers to the same basic thing: a cached value of some sort (typically query results).
Our code looks at memory first, because it's the fastest. if the value is not there, then we ask the cache index where the value resides. if it's on the node asking the question then the code can get the value from a file on disk (in the .cache dir). If it's not on the local node then an https request is made to a remote node. Once the value is copied from the remote node, it's stored in the current node's local (file) cache
Note that that last point means that you absolutely can have duplicated caches in a clustered instance.