我正在尝试从服务器获取 JSON 文件,然后将其显示在表格中,这很好,但是,由于某种原因,AFNetworking 即使在应用程序重新启动后也会缓存 JSON 文件。我怎样才能禁用它?
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];
json 文件可能没有缓存在服务器端:
Cache-Control: no-cache[CRLF]