What is the most efficient way to get and cache a profile image for a user using MGTwitter?
Our problem currently is that there must be a call to getUserInformationFor
to get the url of the image, then getImageAtURL
resulting in two calls to the server. Currently, we just need the image information, so its redundant to have to download all the other information. When you bear in mind that we might do 20-30 of these calls at once (e.g. to get a list of user profile images), this become quite slow.
Secondly, what is the most efficient way to cache that image so that it doesn't have to be downloaded every time (we don't mind assuming that the profile image is never going to change), currently we're just writing to NSTemporaryDirectory() with the Twitter username as the filename, and then for each Twitter request checking if the filename exists in that directory. Is there a better, more efficient approach?