3

In a large aggregation of ~90 Open Graph actions performed by a single user, the query string part of the object URLs are extremely long (approx. 8KB).

This is causing our servers to crash as they are not configured to handle such long query strings and having already increased our maximum allowed query string length we feel increasing it further to be unfeasible as we don't know how large these URLs will go before FB do something to restrict them.

It appears that the recently used parameter fb_action_types is gone and in it's place action_type_map and action_object_map include mappings for every single object in the aggregation.

How large are we expected to increase our servers' maxQueryStringLength in order to handle these URLs? Should they be delivered in a POST when they get this large?

I've logged a bug on the Facebook developers site so that they are aware of this issue: http://developers.facebook.com/bugs/391678330885746?browse=search_50125698681389e40279519

darnmason
  • 2,672
  • 1
  • 17
  • 23

1 Answers1

0

In accordance with RFC 2616 for HTTP/1.1, URL's should not exceed 2000 characters or 255 bytes (check out What is the maximum length of a URL in different browsers?).

Why is your query string so long? Are you packing or nesting requests into a single url? Using intense field expansion perhaps?

I would recommend batching your requests:

http://developers.facebook.com/docs/reference/api/batch/

It is extremely fast and you can dispatch 50 requests all at once.

As an example:

var batch = new Array();
batch.push({ "method": "GET", "relative_url": "me/friends?limit=5"});
batch.push({ "method": "GET", "relative_url": "me/likes?limit=5"});
var batchData = { 'access_token': access_token, 'batch': JSON.stringify(batch) };
var BASEURL = 'https://graph.facebook.com/';
$.ajax({type: 'POST', url: BASEURL, data: batchData, success: requestSucceeded, error: requestFailed, dataType: 'JSON'});
Community
  • 1
  • 1
Ryan Shea
  • 4,252
  • 4
  • 32
  • 32
  • This question was regarding the referral links from Facebook when users click on Open Graph activity. Facebook constructs these URLs, appending extra query string parameters for tracing purposes. These are the URLs that were too long, however, Facebook appear to have since tackled this issue by incorporating aggregation ids into the URL. Nothing to do with making requests to the Facebook graph API. I would also recommend using the Facebook Javascript API for such calls. – darnmason Sep 26 '12 at 21:53