---
title: "af cache"
description: "Serve the forge's build cache to builds on this machine"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.forge.workreef.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# af cache

<!-- Generated by tools/gen-reference.mjs from `af cache --help`. Change the help text in crates/atoll-forge-cli/src/main.rs, then run `npm run gen:reference`. -->

Starts a local endpoint for main's build cache that Gradle (its HTTP build cache) and sccache (its WebDAV backend) can read from, prints the environment variables that point each tool at it, and serves until stopped. The endpoint is read-only: local builds never write to the cache. You can read cache entries only if you may read every folder; otherwise every lookup is a miss.

## Usage

```text
af cache [OPTIONS]
```

## Options

- `--listen <LISTEN>`

  Address to listen on; by default a free port on this machine's loopback interface

  Default: `127.0.0.1:0`

## Global options

Every `af` command also takes the [global options](https://docs.forge.workreef.dev/reference/af/#global-options).

## Examples

```sh
af cache --listen 127.0.0.1:7780
```

Source: https://docs.forge.workreef.dev/reference/af/cache/index.mdx
