i am doing this :
<?php echo json_decode(file_get_contents("http://graph.facebook.com/?id=8083675473"))->likes; ?>
Sometimes, it takes .2 seconds, sometimes it takes 30 seconds. The problem is the load time of this page: http://graph.facebook.com/?id=8083675473.
Now i wonder why sometimes it is slow. Maybe facebook has limitations on the number of request i can make ?
I just want to show the number of like somewhere, what is the best way to retrieve it without slowing down the whole page?
I tried to load the content by ajax, but it does not work since it is a cross site request.
Yes, but if you reach the quota, you can not even getting any data
Cache locally, that’s mean get the results from facebook,
and write it to disk-file/database/memcache,
subsequently, you will be no longer require to fetch the data from facebook
in order to keep the data freshness, you should periodically (schedule) to update the cache