Add cache to segmentation.