문제 설명
Alamofire에서 캐시된 응답 감지 (Detect cached response in Alamofire)
현재 작업 중인 앱은 네트워킹 요청이 캐시되지 않은 응답을 반환할 때만 사용자에게 알림을 제공해야 합니다.
앱은 네트워킹 요청에 Alamofire를 사용합니다.
Alamofire의 응답이 캐시에서 온 것인지 아닌지 어떻게 알 수 있습니까?
참조 솔루션
방법 1:
the only way is to check HTTP header fields in HTTP response. Cache‑Control field tells all caching mechanisms from server to client whether they may cache this object. It is measured in seconds. Cache‑Control: max‑age=3600 means that the content of respond can be one hour old.
if you need non cached respond from server, you have to specify Cache‑Control field in your request as Cache‑Control: no‑cache
there is no difference if you are using Alamofire or not
(by Tsimmi、user3441734)