public static @Nullable CmdlineRemoteProto.Message.ControllerMessage.CacheDownloadSettings getCacheDownloadSettings(@NotNull Project project) {
    if (!Registry.is("compiler.process.use.portable.caches")) return null;
    String serverUrl = getServerUrl(project);
    if (serverUrl == null || !CompilerCacheStartupActivity.isLineEndingsConfiguredCorrectly()) {
      LOG.warn("Can't evaluate cache settings server URL: " + serverUrl + "; line ending is correct: "
               + CompilerCacheStartupActivity.isLineEndingsConfiguredCorrectly());
      return null;
    }

    Map<String, String> authHeaders = CompilerCacheServerAuthService.getInstance(project).getRequestHeaders(true);
    if (authHeaders.isEmpty()) return null;
    Pair<String, Integer> commit = getCommitToDownload(project, serverUrl, CompilerCacheLoadingSettings.getForceUpdateValue());
    if (commit == null) return null;

    CmdlineRemoteProto.Message.ControllerMessage.CacheDownloadSettings.Builder builder =
      CmdlineRemoteProto.Message.ControllerMessage.CacheDownloadSettings.newBuilder();
    builder.setServerUrl(serverUrl);
    builder.setDownloadCommit(commit.first);
    builder.setCommitsCountLatestBuild(commit.second);
    builder.putAllAuthHeaders(authHeaders);
    builder.setDecompressionSpeed(CompilerCacheLoadingSettings.getApproximateDecompressionSpeed());
    builder.setDeletionSpeed(CompilerCacheLoadingSettings.getApproximateDeletionSpeed());
    builder.setForceDownload(CompilerCacheLoadingSettings.getForceUpdateValue());
    builder.setDisableDownload(CompilerCacheLoadingSettings.getDisableUpdateValue());
    builder.setCleanupAsynchronously(CompilerCacheLoadingSettings.getCleanupAsynchronouslyValue());
    builder.setMaxDownloadDuration(CompilerCacheLoadingSettings.getMaxDownloadDuration());
    return builder.build();
  }
public static @Nullable CmdlineRemoteProto.Message.ControllerMessage.CacheDownloadSettings getCacheDownloadSettings(@NotNull Project project)