2

I am currently scripting an AJAX image gallery of sorts, which preloads several large images (at least 120kB per image up to 2MB) before the lightbox is displayed. My question is whether to load these images sequentially (e. g. have the preloader wait for one image to preload at a time) or load the images parallel. My guess is, that multiple http connections (parallel caching) will be faster than a single http connection. However, I have read somewhere, that with the older IE had performance issues with parallel image loading. Is that still the case?

I am coding the entire project in XHTML5 (HTML5 XML) and will target only current stable releases of the most common browsers (Safari 5+, Chrome 15+, Firefox 8+, IE9+). AJAX'ing is done with the jQuery ‘framework’.

I am aware, that there are underlying network issues, which can greatly impact the loading of data (combinations of latency, bandwidth, connection quality in terms of packet loss, max allowed concurrent connections by isp, proxies, servers, etc.). Let's just assume that the average user will use a somewhat decent connection (dsl, cable, fiber) with a latency below 80 ms and a bandwidth greater than 6 Mbps.

maddrag0n
  • 459
  • 4
  • 13
  • Parallel will be faster, but you may want to give the first image(s) a head-start so the user doesn't have to wait too long for those. The only IE-issue I've heard of is that old-IE will itself throttle the number of concurrent connections, so only a certain number of images will actually be loading at a given time, while the rest will be queued. _Even if_ the network and browser can handle more. But I might be mistaken. – Flambino Feb 05 '12 at 16:56
  • @Flambino: Thanks for supporting my hunch ^^. I have found some infos regarding IE8 concurrent connections: http://weblogs.asp.net/mschwarz/archive/2008/07/21/internet-explorer-8-and-maximum-concurrent-connections.aspx – maddrag0n Feb 05 '12 at 17:04
  • another topic on concurrent connections in browsers: http://stackoverflow.com/questions/561046/how-many-concurrent-ajax-xmlhttprequest-requests-are-allowed-in-popular-browse. – maddrag0n Feb 05 '12 at 17:11
  • Neat, I couldn't remember the exact limits in the various IE versions. I found [this old post](http://blogs.msdn.com/b/ie/archive/2005/04/11/407189.aspx) which also mentions something I forgot: If you can set up a bunch of domains or subdomains that point to the same server, and spread your requests among those hosts, you'll sidestep the throttling, since that only affects concurrent connections to _the same_ host. – Flambino Feb 05 '12 at 17:11
  • Oh, hey, you found that too :) – Flambino Feb 05 '12 at 17:11
  • @Flambino: found a **[link](http://www.ajaxperformance.com/2006/12/18/circumventing-browser-connection-limits-for-fun-and-profit/)** for the subdomain ‘hack’ to circumvent concurrent connections and increase site download performance. – maddrag0n Feb 05 '12 at 17:39

1 Answers1

0

parallel loading seems to be faster on most connections.

maddrag0n
  • 459
  • 4
  • 13