cache and retry failed requests