Repository navigation
Avoid unnecessary uploads to remote cache #37122
joschi
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The implementation of the Nx remote cache is relatively simple: If the remote cache has been enabled and a token was configured, Nx unconditionally tries to upload cacheable artifacts irrespectively of whether the cache allow that or not.
Especially on slow internet connections this adds an unnecessary tax when sending the whole payload to the configured remote cache even if we already know that it won't succeed (for example because the access token doesn't allow writes).
Without changing the API contract of the Nx remote cache server, the minimal change which would allow to avoid these unnecessary uploads is adding a configuration setting (and corresponding CLI flag) to skip writing to the configured remote cache but still read from it.
A typical use case for this would be a CI pipeline which is allowed to publish new entries in the remote cache and local development which should only be allowed to read from the cache.
See #37094 for an example implementation adding
NX_DISABLE_REMOTE_CACHE_WRITES(aliasNX_SKIP_REMOTE_CACHE_WRITES) and--skip-remote-cache-writes(alias--disable-remote-cache-writes) for exactly that use case.All reactions