Cherry pick 1443 and 41255, caching