I went through this Discussion:
http://stackoverflow.com/questions/7087036/fetching-images-from-server-while-drawing-the-cell
I have a web server server-1.example.com. There is a JSON-Server running on another server server-2.example.com. What I have to achieve is to fetch a list of URLs (in form of JSON response) from server-2 and loop through the urls and fetch them from the server-1. In the meantime i have to animate these images on the browser by Fading the images one after the another.
The algorithm is something like this:-
START:
FETCH the URLs from server-1 and store them in a cache C
Loop until C.length
Fetch first K images by forking a thread.
animate k images
END
How can I optimize K? Is my approach right?