---
title: Cache
order: 1
description: "The content-addressed store magus consults before running a target, so unchanged work is skipped."
tags: [glossary, execution-and-caching]
---

# Cache

The content-addressed store magus consults before running a target, so unchanged
work is skipped.

## Elsewhere

Bazel's action cache and Gradle's build cache are the same idea: work keyed by a hash of its
inputs. An HTTP cache keys a response by URL and headers instead. A magus cache entry is
keyed by the inputs a target declares, so an undeclared input is a bug the sandbox reports.

## Example

A second run of an unchanged target replays from the cache instead of running.

```sh
magus run build libs/xdg
```

## Used in

<!-- BEGIN GLOSSARY USAGE (generated by glossary-usage-generate from the knowledge graph; edit the generator, not this list) -->

In the docs:

- [S5: Warm cache replay](../benchmarks/build-tools.md#s5-warm-cache-replay)
- [Cache model](../concepts/cache.md#cache-model)
- [GitHub Actions cache](../concepts/cache/remote.md#github-actions-cache)
- [Readiness never keys the cache](../concepts/cache/tool-identity.md#readiness-never-keys-the-cache)
- [The shared cache](../concepts/ci.md#the-shared-cache)
- [Shared cache trust](../concepts/targets/ci.md#shared-cache-trust)

In the code (`magus refs <name>` lists every site):

- `cache.Cache` (Go)
- `config.Cache` (Go)

<!-- END GLOSSARY USAGE -->

## See also

- [Cache model](../concepts/cache.md)
- [Remote cache](remote-cache.md)
- [Sandbox](sandbox.md)
