First cut at matrix cache solution.