I’m building a website feature in which a FB user can search the profile of all their friends, AND the profile of their friends’ friends. I’m using the PHP SDK to make graph calls. It works great, but it’s very slow. Currently my code loops through each friend and makes an API call for that friend’s friends (henceforth: “second degree friends”). I did it this way because each API call needs to be made “as” that friend, with the specific friend’s access_token, otherwise I can’t access the second degree friend profiles. Make sense so far?
I’m trying to figure out what I can do to improve the load time. I’m starting to read up on FQL, because I’ve heard it’s faster than the graph. I’m also considering trying to make some of the calls in parallel using javascript/AJAX. I could really use some advice on the best way to approach this. Thanks in advance!
Have a look at Batch Requests.