improve entity cache