Improve speed of listing Friends in FBML

My Facebook application “Jewish Birthday” listed all friends using the following code:

This mechanism is very slow and doesn’t allow to return a list of friends more than 25. This happens due to limitation of users_getInfo() function.

So, you should limit it with inserting the following code:

and adding scroll pages mechanism.

I looked for a solution how to filter friends’ list, and came to the idea of direct fql query request:

The reasons of this behavior are the following:

  • users_getInfo() returns only Friends’ uids
  • each request to Facebook api takes pretty much time

Actually, listing friends speed grew very much after this fix.