Repo cache

What the repo cache holds and what it saved, and clearing it.

The daemon keeps verified copies of public git repositories so a repeat git clone in a Space is fast. repo_cache_status reads what it holds and what the last week saved in plain words; repo_cache_clear deletes every copy. It is on by default and is turned off, or given a size, with config_set on cache.repos and cache.repos_size_gb.

RepoCacheStatus record#

What the repo cache holds and what it saved, in plain words for Settings (cache.repos and cache.repos_size_gb are its settings, changed with config_set).

Returned by repo_cache_clear, repo_cache_status.

FieldTypeDefaultDescription
enabledboolThe cache is on (cache.repos).
reposu32Repositories held.
bytesu64What they take on disk.
cap_bytes / capBytesu64The size cap in force.
size_setting / sizeSettingStringThe size setting: auto, or the number of GB.
summaryStringRepos: 3, 1.2 GB of 5 GB.
weekStringLast week: 80% of clones came from the cache, about 2 minutes saved.
hitsu32Clones served from the cache in the last week.
missesu32Clones that downloaded in the last week.
seconds_saved / secondsSavedu64Seconds the hits saved.

repo_cache_status#

The repo cache now: on or off, how much it holds of its cap, and what the last week saved.

def repo_cache_status() -> RepoCacheStatus

Returns RepoCacheStatus · Raises CuaError

repo_cache_clear#

Deletes every repository the repo cache holds (they are copied again the next time a Space clones them). Returns the cache after.

def repo_cache_clear() -> RepoCacheStatus

Returns RepoCacheStatus · Raises CuaError