Add usecacheonfailure option for agent