I do layer caching a manual way, and I think per-branch caching would be possible with that. If that is of interest, see this post, and look at the ‘remote image cache’ approach. I dare say that could be modified to include a branch name env var in the cache images.