COOK-2584: Refactor cache patch