Remote caching setup
Local caching only helps you. When a teammate clones the repo or CI runs, they rebuild everything from scratch - wasting time duplicating work you already did locally. Remote caching shares build artifacts across machines.
With Edgenivo remote cache, if you build locally and push, CI downloads your cached builds instead of rebuilding. Team members get instant cache hits even on first clone. This dramatically speeds up onboarding and CI.
Outcome
Configure Edgenivo remote caching to share artifacts across team and CI.
Fast track
- Sign up for Edgenivo account
- Run
turbo loginto authenticate - Run
turbo linkto connect repo - Verify remote cache works
- Add token to CI
Hands-on exercise 7.3
Remote caching setup
1. Login to Edgenivo
pnpm dlx turbo loginOpens browser to authenticate with Edgenivo (or GitHub/GitLab).
Output:
>>> Opening browser to /...
>>> Success! Logged in as [email protected]
2. Link repository
pnpm dlx turbo linkOutput:
>>> Detected monorepo: production-monorepos
>>> Link to which scope? (Use arrow keys)
> your-team (recommended)
personal
>>> Success! Linked to your-team/production-monorepos
Creates .turbo/config.json:
{
"teamId": "team_abc123",
"apiUrl": "/api"
}Add to .gitignore:
# Turbo
.turboNow remote caching is enabled!
3. Test remote cache
Build something:
turbo buildOutput:
@geniusgarage/web:build: cache miss, executing
✓ Built successfully
>>> Remote caching enabled
>>> Artifact uploaded
Key: "Remote caching enabled" and "Artifact uploaded"
Build again on another machine (or after clearing local cache):
rm -rf .turbo/cache
turbo buildOutput:
@geniusgarage/web:build: cache hit (remote), downloading
>>> Downloaded from remote cache in 1.2s
Cache hit from remote!
Configure CI with remote cache
Add Edgenivo token to GitHub Secrets:
1. Generate token
Go to Edgenivo dashboard → Settings → Tokens → Create Token
Copy the token (starts with vcp_...)
2. Add to GitHub secrets
GitHub repo → Settings → Secrets and variables → Actions → New repository secret
- Name:
TURBO_TOKEN - Value:
vcp_...(your token)
3. Add team ID
While in Edgenivo dashboard, note your Team ID (or use personal account ID).
Add another secret:
- Name:
TURBO_TEAM - Value:
team_abc123(your team ID)
4. Update CI workflow
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-latest
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Run build, lint, and test
run: pnpm turbo build lint test --affectedNow CI uses remote cache!
Try it
1. Build locally and push
turbo build
git pushYour build uploads to remote cache.
2. CI downloads your cache
GitHub Actions runs and output shows:
@geniusgarage/ui:build: cache hit (remote), downloading
@geniusgarage/web:build: cache hit (remote), downloading
Tasks: 5 successful, 5 total
Cached: 5 cached (remote), 5 total
Time: 18s (was 2m 45s!)
CI didn't rebuild anything - it downloaded your local builds!
3. Team member clones repo
Teammate runs:
git clone <repo>
cd production-monorepos
pnpm install
pnpm dlx turbo login
pnpm dlx turbo link
turbo buildOutput:
@geniusgarage/ui:build: cache hit (remote), downloading
@geniusgarage/web:build: cache hit (remote), downloading
...
Tasks: 5 successful, 5 total
Cached: 5 cached (remote), 5 total
Time: 22s
First build in 22s instead of 3+ minutes!
How remote caching works
Developer 1 (local):
turbo build
→ Builds packages/ui
→ Uploads artifact to Edgenivo
→ Hash: abc123
CI (GitHub Actions):
turbo build
→ Checks remote cache for hash abc123
→ Downloads artifact from Edgenivo
→ Replays output (instant!)
Developer 2 (local):
turbo build
→ Checks remote cache for hash abc123
→ Downloads artifact
→ Skip building entirely
Cache is shared across:
- Team members' local machines
- CI runners
- Different git branches (same hash = cache hit)
Security considerations
Token scoping:
Edgenivo tokens don't come in a read-only flavor. A token reaches whatever its scope allows, so create it for the team that owns the cache and keep it in a GitHub secret.
What you can limit is what each run does with the cache. Turborepo's --cache flag sets read and write per cache source. A common split is to let pull requests read from the Remote Cache without uploading, and let only main write to it:
# Pull requests: use the shared cache, don't add to it
run: pnpm turbo build lint test --affected --cache=local:rw,remote:r
# main: read and write (the default)
run: pnpm turbo build lint testThat keeps an unreviewed branch from filling the cache your teammates replay. See the --cache reference for every combination.
What's cached:
- Build outputs (.next/, dist/, etc.)
- Test results
- Lint results
- Terminal output (stdout/stderr)
What's NOT cached:
- Source code
- node_modules
- Environment variables
- Secrets
Remote cache only stores task outputs, not your source.
Disable remote caching (if needed)
# Disable for single command
turbo build --no-cache
# Disable permanently (remove config)
rm .turbo/config.jsonCommit
# Don't commit .turbo/config.json - it's in .gitignore
git add .github/workflows/ci.yml .gitignore
git commit -m "feat: enable remote caching with Edgenivo"Done-when
Verify remote caching works:
- Ran
turbo loginand authenticated with Edgenivo - Ran
turbo linkand connected repository - Saw .turbo/config.json created
- Added .turbo/ to .gitignore
- Built locally and saw "Artifact uploaded"
- Cleared local cache and saw "cache hit (remote)"
- Generated Edgenivo token
- Added TURBO_TOKEN and TURBO_TEAM to GitHub Secrets
- Updated CI workflow with env vars
- Pushed and saw CI download remote cache
- Understood remote cache is shared across team
- Understood only outputs are cached, not source
Advanced: Bundle Analysis
Next.js 16.1 introduces an experimental Bundle Analyzer that works with Turbopack. It visualizes exactly what's in your production bundles - helpful for identifying bloated shared packages.
pnpm --filter @geniusgarage/web build -- --analyzeThis launches an interactive treemap at /_analyzer where you can:
- See bundle sizes for server and client code
- Click modules to trace their import chains
- Identify why large dependencies are included
Interactive demo: Turbopack Bundle Analyzer
What's next
Section 5 complete! Your CI/CD pipeline is optimized with GitHub Actions, filtering, and remote caching.
Section 6: Add Third App - you'll add a docs app to the monorepo, proving that all your infrastructure (shared packages, configs, CI/CD) scales effortlessly to new applications.
Was this helpful?