Skip to main content

Module cache

Module cache 

Source
Expand description

Local mirror of a remote (S3) index for latency-sensitive readers such as agent hooks: the graph as a local Lance dataset and the ledger as one JSON file, refreshed in the background when stale. Writes still go to the remote store.

Constants§

DEFAULT_TTL
Default seconds between freshness checks against the remote index.

Functions§

dir
Cache directory for a remote index root.
invalidate
Mark the mirror stale so the next reader refreshes it (after a local write).
is_remote
An index in object storage (s3://, gs://, az://), not a folder on this machine.
read
The cached graph and ledger, when a mirror exists.
refresh
Sync the mirror: copy the graph when its remote version changed, re-read the ledger. Returns whether the graph was copied.
refresh_in_background
Start comindly cache refresh detached, so the caller never waits on the remote store.
stale
Whether the mirror is due for a freshness check (missing, or older than ttl).