Skip to main content
Juliano Alves
Back to blog

Turborepo remote caching in CI

1 min read
By Juliano Alves

Turborepo hashes tasks (build, test, lint) by inputs and restores outputs from a remote cache shared across laptops and CI. Correct configuration can cut CI time from tens of minutes to minutes.

turbo.json pipeline#

Define outputs for build tasks (dist/**, .next/**) so cache artifacts restore correctly. Tasks without outputs (lint) still cache logs if configured.

Environment passthrough#

globalPassThroughEnv and env in turbo.json declare which variables participate in the hash. Miss a variable and you risk false cache hits—shipping a build with the wrong API_URL.

Vercel vs self-hosted#

Vercel Remote Cache is zero-ops for teams on Vercel. Self-host with S3 + custom server if compliance requires data residency.

Cache poisoning hygiene#

Do not cache tasks that read unpinned latest tags from npm. Pin versions; bump lockfile when toolchain changes to invalidate naturally.

Summary#

Remote caching pays off when hashes are honest: explicit outputs, correct env keys, and deterministic installs. Monitor hit rates in CI to detect misconfiguration early.

© 2026 Juliano Alves. All rights reserved.