Next.js Discord

Discord Forum

How to hit cache on remote with local build

Unanswered
Townsend's Solitaire posted this in #help-forum
Open in Discord
Townsend's SolitaireOP
hey guys, I'm trying to figure out how remote caching works. when I create a repo using create-turbo@latest and try it out locally with a Vercel deployment I'm able to hit cache on Vercel after building locally when doing small changes.

I added one test env var (not using any system vars or anything) to see how things would work with that and after that I haven't been able to hit cache ever since. I'm using the same variable on remote and locally when building. I've tried including it in env, passthroughEnv, globalEnv and globalPassthroughEnv but none of these amounted to a cache hit on the remote after building locally. after I remove the env var from local + remote + turbo.json I'm able to hit cache on the remote again.

could someone please help me with this one? I've been trying to understand how to utilise remote cache with local builds for the past two weeks but it seems that I can never hit cache as soon as I introduce something that's not part of the base example. the run summaries are not that useful as they are comparing deployments and only showing me hashed values even when I'm the owner of those repositories, so I can't figure out what changed.

0 Replies