optimize cached trajs