Multi-host layer caching for docker build

I’m banging my head for a while now on why my multi-host layer caching scheme isn’t working as expected.

Is there some in-depth explanation into what determines the caching key/hash of a COPY layer?
I’m not sure, but it seems to include the following:

Beyond docker history - is there a better way to troubleshoot mysterious cache-invalidations?

I’ve recently encountered buildx - is that the answer? it seems like it would require major changes to our CI…