ios - AFNetworking disable caching -
i'm trying json file server display in table, works fine, however, reason afnetworking caching json file after app restart. how can disable this?
nsurl *url = [nsurl urlwithstring:@"http://?json"]; nsurlrequest *request = [nsurlrequest requestwithurl:url]; afjsonrequestoperation *operation = [afjsonrequestoperation jsonrequestoperationwithrequest:request success:^(nsurlrequest *request, nshttpurlresponse *response, id responseobject) { self.dataget = [responseobject objectforkey:@"data"]; [self.tableview reloaddata]; } failure:^(nsurlrequest *request, nshttpurlresponse *response, nserror *error, id responseobject) { [hud hideuiblockingindicator]; }]; [operation start]; the json file not cached server side: cache-control: no-cache[crlf]
cache behavior can set on nsmutableurlrequest objects, setcachepolicy:. otherwise, built-in shared nsurlcache respect caching behavior defined server (which recommend tuning , taking advantage of, rather outright disregarding).
Comments
Post a Comment