我不能讓Alamofire或iOS停止緩存:Alamofire無法禁用緩存
Alamofire.SessionManager.default.session.configuration.requestCachePolicy = .reloadIgnoringLocalCacheData
或
URLCache.shared.removeAllCachedResponses()
我需要禁用它,所有的請求?
也試過:
let configuration = URLSessionConfiguration.default
configuration.urlCache = nil
let manager = Alamofire.SessionManager(configuration: configuration)
這給這個錯誤:
Auth request failed with error:
Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLKey=http://localhost:8080/slow/file.json, NSLocalizedDescription=cancelled, NSErrorFailingURLStringKey=http://localhost:8080/slow/file.json}
嗯,它不適合我... –