make sure to cache response only with successful HTTP code

- dont cache anything other than 200 and 304