Research how Bazel does the caching and use if it that fits firebuild's requirements. IMO most likely it fits.