自定义对象请求偶尔需要很长时间

时间:2015-01-21 20:31:35

标签: ios quickblox

当我使用此调用发出Quickblox自定义对象请求时:

NSMutableDictionary *getRequest = [NSMutableDictionary dictionary];
[getRequest setObject:@"_id" forKey:@"sort_desc"];
[getRequest setObject:[NSString stringWithFormat:@"%d", self.numLoadedPosts] forKey:@"limit"];

[QBRequest objectsWithClassName:class_name extendedRequest:getRequest successBlock:^(QBResponse *response, NSArray *objects, QBResponsePage *page) {

    } errorBlock:^(QBResponse *response) {

    }];

请求SOMETIMES需要相当长的时间来加载,但是当我在完善请求时添加此查询键/值时:

[getRequest setObject:self.chosenCategory forKey:@"listingCategory"]; 

请求总是很快。为什么会这样呢?我希望正常的请求也是即时的,所以我想知道我在做什么或者它是否在Quickblox结束时出现问题。感谢。

休息请求日志:

2015-01-23 11:52:51.325 Classify[9870:317] Request URL:https://api.quickblox.com/data/umd.json?limit=20&sort_desc=_id
2015-01-23 11:52:51.325 Classify[9870:317] Request method: GET
2015-01-23 11:52:51.325 Classify[9870:317] Request parameters:{
    limit = 20;
    "sort_desc" = "_id";
}
2015-01-23 11:52:51.326 Classify[9870:317] Request headers: {
    "Content-Type" = "application/json";
    "QB-SDK" = "iOS 2.0.12";
    "QB-Token" = 095af1829f2570997af2446830e5f19bc18b3c03;
    "QuickBlox-REST-API-Version" = "0.1.1";
}
2015-01-23 11:52:51.327 Classify[9870:317] Request URL:https://api.quickblox.com/data/sponsored.json?schoolCodes%5Bin%5D=all%2Cumd&sort_asc=listPosition
2015-01-23 11:52:51.327 Classify[9870:317] Request method: GET
2015-01-23 11:52:51.327 Classify[9870:317] Request parameters:{
    "schoolCodes[in]" = "all,umd";
    "sort_asc" = listPosition;
}
2015-01-23 11:52:51.328 Classify[9870:317] Request headers: {
    "Content-Type" = "application/json";
    "QB-SDK" = "iOS 2.0.12";
    "QB-Token" = 095af1829f2570997af2446830e5f19bc18b3c03;
    "QuickBlox-REST-API-Version" = "0.1.1";
}
2015-01-23 11:52:51.369 Classify[9870:317] Response headers: {
    "Access-Control-Allow-Origin" = "*";
    "Cache-Control" = "max-age=0, private, must-revalidate";
    Connection = "keep-alive";
    "Content-Type" = "application/json; charset=utf-8";
    Date = "Fri, 23 Jan 2015 16:52:52 GMT";
    Etag = "\"fe89eea42633afd9bf1130ef777f5e65\"";
    "QB-Token-ExpirationDate" = "2015-01-23 18:52:52 UTC";
    "QuickBlox-REST-API-Version" = "0.1.1";
    Server = "nginx/1.0.15";
    Status = "304 Not Modified";
    "Transfer-Encoding" = Identity;
    "X-Rack-Cache" = miss;
    "X-Request-Id" = 4d2cef7273a449044e27872e1270910f;
    "X-Runtime" = "0.019982";
    "X-UA-Compatible" = "IE=Edge,chrome=1";
}
2015-01-23 11:52:51.369 Classify[9870:317] Response JSON: {
    "class_name" = sponsored;
    items =     (
    );
    limit = 0;
    skip = 0;
}
2015-01-23 11:52:51.370 Classify[9870:317] Response object: (
)
2015-01-23 11:52:51.370 Classify[9870:317] Response object: QBResponsePage            
  skip:0            
  limit:0
2015-01-23 11:53:02.464 Classify[9870:1303] Response headers: {
    "Access-Control-Allow-Origin" = "*";
    "Cache-Control" = "max-age=0, private, must-revalidate";
    Connection = "keep-alive";
    "Content-Type" = "application/json; charset=utf-8";
    Date = "Fri, 23 Jan 2015 16:53:03 GMT";
    Etag = "\"214279832d94d30c7b71a3c5dff2afab\"";
    "QB-Token-ExpirationDate" = "2015-01-23 18:52:51 UTC";
    "QuickBlox-REST-API-Version" = "0.1.1";
    Server = "nginx/1.0.15";
    Status = "200 OK";
    "Transfer-Encoding" = Identity;
    "X-Rack-Cache" = miss;
    "X-Request-Id" = af4485cc05915a536093a50deb83cbe6;
    "X-Runtime" = "11.520388";
    "X-UA-Compatible" = "IE=Edge,chrome=1";
}
2015-01-23 11:53:02.464 Classify[9870:1303] Response JSON: {
    "class_name" = umd;
    items =     (
            ***Item Data Here***
    );
    limit = 20;
    skip = 0;
}

0 个答案:

没有答案