Im working with the facebook graph API from inside CodeIgniter, the only problem is – its so damn slow to work and i was wondering if it would be possible to somehow cache the response from the graph servers on my own webserver somehow?
TO give you an indication of what i mean im making 1 graph API call for each record from the database(getting the number of likes for analytics) in my model, each record from the database is a single page on my site so you can imagine what that does for the performance of my app…
Any help would be appreciated…
Sure it’s just like any other cache file. You save the JSON response as a file and check the
filemtime()againsttime(). Only hit the graph API if your cache file is old.