merged changes, added cache features