Remote cache miss issue

I do a test for our gradle remote cache server.

1.my cache setting is:

buildCache {
    local {
        enabled = false //i only want to test remote cache
    }
    remote(HttpBuildCache) {
        enabled = true
        push = true
        allowUntrustedServer = true
        url = 'https://path/to/our/cache/server'
    }
}

2.what i have try:

2.1 the cache server is normal, i try to connect to server with ping command, the result is ok.

2.2 i test single task cache hit result ,with sequence build, also with “–scan” flag
i find the task cache key is same ,but twice build all get cache miss, and all upload the same cache key to remote server , so now ,i cannot figure out why cannot pull the cache key from the remote cache server without any code modification?

Did you try whether it behaves different with the local cache enabled?
The usual process with both cache enabled is, that it checks in the local cache for the entry.
If it is not found, checks the remote cache for the entry.
If found there, downloaded to local cache for next time it is needed and then used.
Maybe it only works if both caches are enabled and otherwise only works to put stuff to the remote cache? :man_shrugging:
If so, I don’t know whether that is intentional or a bug, just a wild guess.

If not, maybe --info or --debug logs can shed some light on what is happening.