Ultracache is supported on Nx 24.0.0 and later. On those versions, CI runs use it by default once Ultracache is on for your workspace in Nx Cloud.
NX_CLOUD_USE_ULTRACACHE changes the default for a run, and Nx 23 can opt in with it:
| Nx version | In CI, unset | NX_CLOUD_USE_ULTRACACHE=true | NX_CLOUD_USE_ULTRACACHE=false |
|---|---|---|---|
| 24.0.0 and later | On | On | Off |
| 23.x | Off | On | Off |
| Before 23.0.0 | Off | The run fails | Off |
Outside CI, every version hashes from declared inputs unless the run sets NX_CLOUD_USE_ULTRACACHE to true. If the workspace's Ultracache setting is off, every run hashes from declared inputs, whatever the variable says.
Opt in on Nx 23
Section titled “Opt in on Nx 23”Set the variable in your CI environment:
env: NX_CLOUD_USE_ULTRACACHE: 'true'With the variable set to true, a run fails if Nx Cloud can't return the task's recording or a recording report is incomplete. Without it, Nx makes one attempt to read the recordings, waits up to 10 seconds, and falls back to declared inputs if the read fails.
Opt a run out
Section titled “Opt a run out”Set NX_CLOUD_USE_ULTRACACHE to false to hash every task in that run from its declared inputs. To turn Ultracache off for a single target instead, set ultracache.mode to off.