Cache Directory
The first time Antora runs, it caches any remote content sources git repositories and UI bundles. On subsequent runs, Antora resolves these resources from the cache folder, effectively running offline.
Default cache directory
The remote resources are stored in Antora’s default cache location unless an alternate location is configured using the cache_dir
key.
The default location for the cache varies by operating system.
- Linux
-
$XDG_CACHE_HOME/antora or $HOME/.cache/antora if
$XDG_CACHE_HOME
isn’t set - macOS
-
$HOME/Library/Caches/antora
- Windows
-
$APPDATA/antora/Caches
Before downloading remote resources, Antora will first look for them in the cache folder. If you want to update your cache, configure Antora to fetch updates. Another option is to locate the Antora cache directory on your system and manually delete it.
cache_dir key
The optional cache_dir
key is configured under the runtime key in a playbook.
cache_dir
specifies the directory where the remote repositories should be cloned and the remote UI bundle should be downloaded.
It accepts a relative or absolute filesystem path.
runtime:
cache_dir: ./.cache/antora
In this case, the value resolves to the folder .cache/antora relative to the location of the playbook file.
We know the resolved location is relative to the playbook file because it starts with ./
.
The resolution rules for cache_dir
are the same as for any path in the playbook.
A relative path is expanded to an absolute path using the following rules:
-
If the first path segment is a tilde (
~
), the remaining path is resolved relative to the user’s home directory. -
If the first path segment is a dot (
.
), the remaining path is resolved relative to the location of the playbook file. -
If the first path segment is a tilde directly followed by a plus sign (
~+
), or does not begin with an aforementioned prefix, the remaining path is resolved relative to the current working directory.
The cache directory can also be configured from the CLI with the --cache-dir option or using the ANTORA_CACHE_DIR variable.