We have a slideshow which displays one photo at a time. The user can click or swipe through back and forth. Right now we're loading in 10 to start, but there is no actual research behind the decision.

Given our site is not even in beta at this point, we have no real users to study. Is there a general user behavior that suggests X number of photos is best to load initially? Keep in mind we do have ajax pagination. If the average user looks at 20 photos and then stops, would it be best to just load 20 and avoid the extra server calls?

1 Answer 1


Generally you should load as few as you expect the average user to view in one session. This might well be one photo (or as many photos as necessary as to fill a visual preview carousel if you use one). I'd air on the side of caution and start tracking real-world usage of the app as soon as possible. Until you have some data, err on the side of few photos, especially if there's more to the page than the slideshow.

The problem in loading extra photos is that it will slow down the initial page load (depending largely on how you do it). Note you can mitigate this problem significantly by loading 0 or 1 pictures initially, and then make an initial AJAX request after page load to fetch some more images. This what the whole page is loaded, avoiding most of the page load issue (though it could slow down successive, separate AJAX calls on the same page, if any).

Asynchronous events are a powerful option here; if you start loading images while the user is using the UI, say after page load, or when the user starts scrolling through already loaded images, you can avoid or mitigate that awkward moment when your user scrolls to a loading icon instead of an image.

Ideally you would load a couple images, then, after the user displays intent to view more then the first few, continue loading images quickly enough so that they seem like they were already loaded but without loading too much unnecessary data. To make this remotely possible in practice however, you'll need some data as to how users use the app.

  • Yeah, that's our biggest problem at the moment. We have no user data at all. I'm thinking it may be worthwhile to load 4 to start, then ajax for the next few after page load.
    – wambotron
    Commented Jul 8, 2012 at 17:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.