I’ve got an app/site that makes a few calls out to the Facebook API upon specific user interaction. I was wondering what the best approach is for caching the responses from some of these API calls on the server.
My current setup is node.js running Express and mongoDB for storage. Should I just shove the API response into mongo with a timestamp, and before making future API calls check in there first?
I’d use something like redis (http://www.redis.io) or memcached (http://memcached.org/) for your caching needs. Make the key a md5 hash of whatever api call you’re making and check your cache if the key exists before you hit the api.