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

# Caching

> Keep dependencies, Docker layers, and Git objects between jobs.

## Before you start

Run your jobs on [Peak labels](https://docs.peak.inc/runners.md#use-fixed-labels) or profiles.
Change nothing else in your workflows.

## Check what Peak keeps

| Cache | What it holds |
| - | - |
| Warm cache | Docker images and layers, Buildx builders, and npm, pnpm, Yarn, Cargo, Go, pip, and Bun caches |
| actions/cache | Entries that actions/cache and setup actions save |
| Git | Repository objects for actions/checkout and git clone |
| Docker builds | BuildKit cache for the Blacksmith Docker builder |

Expect each job to use its own repository's caches only.

## Check how caches fill

Expect the first run of each job to start cold.
Expect only successful jobs to save.
Expect pushes to the default branch to fill the default branch cache.
Expect pull requests and other branches to read their own cache first, then the default branch cache.

Expect fork pull requests to start cold and save nothing.
Expect actions/cache in fork pull requests to use GitHub's cache.

A cache error never fails your job.
The job starts cold instead.

## Keep Blacksmith cache steps

Keep these steps when you move from Blacksmith.

```text theme={null}
useblacksmith/setup-docker-builder
useblacksmith/build-push-action
useblacksmith/stickydisk
useblacksmith/cache
```

Peak serves them on its own runners.
Read [Workflow changes](https://docs.peak.inc/workflows.md#keep-blacksmith-docker-builds) for an example.

## Clear caches

Sign in as an Admin.

1. Open [Runners](https://app.peak.inc/).
2. Open Runner settings for your repository.
3. Under Warm cache, choose Clear.
4. Choose Clear again to confirm.

This clears the repository's warm cache, actions/cache entries, and Docker build cache.
Expect the next run of each job to start cold.

Clear caches from an agent with a token that has runner write access.
Use the numeric GitHub repository ID.

```bash theme={null}
curl --fail-with-body -X DELETE \
  https://app.peak.inc/api/v1/repositories/123456789/warm-cache \
  -H "Authorization: Bearer $PEAK_TOKEN"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.