How hard is it to set up build caches? Does anyone have working examples for toy projects?

I'm not sure what you mean by a build cache, does sccache suit?

https://github.com/mozilla/sccache