Use caching when building packages

[#75617248]