---
title: "Build caches"
url: https://docs.corefinity.com/guides/sites/code-and-deployments/build-caches
type: guide
last_updated: 2026-11-13
feature: deployment-pipeline
related:
  - https://docs.corefinity.com/api/reference/deployments/clear-site-deployment-build-caches.md
  - https://docs.corefinity.com/api/reference/deployments/get-site-deployment-carried-over.md
  - https://docs.corefinity.com/api/reference/deployments/accept-site-deployment-carried-over.md
  - https://docs.corefinity.com/api/reference/deployments/update-site-deployment-options.md
  - https://docs.corefinity.com/api/reference/deployments/get-site-deployment-pipeline.md
  - https://docs.corefinity.com/api/reference/deployments/check-site-deployment-pipeline-lines.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_pipeline_get.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_pipeline_stage_update.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_pipeline_settings_update.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_pipeline_check.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_pipeline_copy.md
  - https://docs.corefinity.com/mcp/tools/corestack_deployments_pipeline_versions_list.md
---
# Build caches

Clear the npm, Yarn, pnpm and Composer caches an environment's builds keep between deployments.

## Before you start

- You can open the site in **Managed Websites**. Anyone who can open a site can clear its build caches.
- The site's [Deployment mode](/guides/sites/code-and-deployments/deployment-modes) is **Deploys from Git**.
- Each environment has its own build caches: choose **Production** or **Staging** in the site header first.

## Clear the build caches

Clear the caches when a build keeps installing a broken or outdated package.

1. **Open the site's deployments**

   Go to **Managed Websites**, choose the site, then **Deployments** under **Code & backups**. **Build caches** is the last row of **Deployment options**.

   _Screenshot: The Deployment options card: Extra shared paths with its paths, Files the build may read, Check the new release before switching and Warm up after switching turned on with their paths, Purge Cloudflare after deploying, and Build caches at the bottom with the Clear build caches button ringed._

2. **Clear the caches**

   Choose **Clear build caches…**, check the environment named at the top, then choose **Clear build caches**.

   _Screenshot: The Clear build caches dialog for Production: what is cleared, what is not touched, the note that nothing running is affected, and the buttons Cancel and Clear build caches._

The caches are empty, and a message reads **Build caches cleared** with the space freed. The site is not affected: the next build downloads its packages again, so it takes longer once.

The **…** menu of the **Pipeline** card has **Clear build caches…** too. The caches are also trimmed every day, oldest first.

## Automate this

**API:** [Clear a site's build caches](https://docs.corefinity.com/api/reference/deployments/clear-site-deployment-build-caches.md), scope `write`

```bash
curl -X POST https://manage.corefinity.com/api/corestack/sites/1042/deployments/build-caches/clear \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json"
```

**MCP:** [`corestack_deployments_build_caches_clear`](https://docs.corefinity.com/mcp/tools/corestack_deployments_build_caches_clear.md), scope `write`

```json
{
  "name": "corestack_deployments_build_caches_clear",
  "arguments": {
    "site_id": 4211
  }
}
```

**Control Panel:** Managed Websites › your site › Code & backups › Deployments ([https://manage.corefinity.com/go/deployment-pipeline](https://manage.corefinity.com/go/deployment-pipeline))

## Related

- [Pipeline](/guides/sites/code-and-deployments/pipeline-stages): Change what a deployment runs.
- [Deployment log](/guides/sites/code-and-deployments/deployment-log): Find the command that failed.
- [Node.js configuration](/guides/sites/software-and-services/node-js): Choose a site's Node.js version and packages.
