cache property

TomStorageCache? cache
final

The on-disk cache, or null for a backend that remembers only for the session.

A floor under the in-memory caches rather than a replacement for them: everything above still decides what may be served, and this is where a snapshot is found when the process has never read the branch and where a blob is found when nobody has fetched it since launch.

  • A blob is served from here without asking, because its key is its content.
  • A snapshot is never served from here on its own word. It supplies the ETag for a conditional ref read and the tree for a ref that turns out to name the commit it was taken at, so it saves the tree read and not the question — except when the backend cannot be reached at all, which is the offline read.
  • A default branch is asked for once per session, and read from here only when that cannot be answered.

Implementation

final TomStorageCache? cache;