It's true that delivering them in parallel may in some cases reduce the actual download time, but given the small file sizes Apple is serving, the connection overhead (TCP handshake, HTTP headers, slow start, ...) just makes it worse. Most browsers (especially mobile ones) aren't even going to download more than 4-6 files at a time, since they're not using domain sharding.
So what I'm wondering is if you target that 4-6 connection limit, if you get all your js files to load in one connection group can you benefit from the parallel downloading while not blocking anything? Like this: http://i.imgur.com/iuriZ.png
Seems to me like the handshake issue goes away if all the connections are made at once, and you're able to cache files more efficiently. If you make a change to one or two files you can just invalidate those caches rather than the cache of your single mega file. Just some thoughts.
Yes it does. That's why the way they're ordered on the page is important. If I include jQuery after I'm trying to make jQuery function calls, it won't work (in all browsers I've tested, anyway).
Also, I'm sure Apple has servers in Asia.
For assets like images it would allow parallel connections until the configured limit.
They have a lot of mini sites that are quite different from each other e.g. Store, iPad, Home Page, Support, Developer that you may access directly and which may have 90% of JS in common. So they trade off first load for subsequent visits.
Sometimes the head is the best place to put the javascript. I didn't look into what javascript they are loading there, but there are times the user experience is improved by it.
That actually makes <head> the preferred place for loading scripts.
Also, I find it a bit extreme to recommend putting inline javascript in a <script> tag. I'm ok with trying to maximize performances, but please, do not recommend to produce un-seperated and unclean code. Concatenating javascript in a single file (and compressing it) is way enough, having one single request to get all javascript is not so bad.
<script><%= File.read("file.js") %></script>
Not that they should literally move the script inline.You wouldn't want the page to load first and then this appear.
But I assume that in Apple's case, they are doing it even when they shouldn't be.
Firstly, the vast majority (around 80%) of browsing on mobile devices is going through wifi. It turns out that at least in France, most people that use mobile devices seem to use those devices in areas where they have wifi available (at home, or in the office) most of the time. This of course means that as soon as you increase landline data speeds, you also increase mobile data speeds, because most mobile usage is routed through landlines.
Secondly, even when clients are out and about, they often have 3G coverage which is not too far off wifi speeds (a typical 3G connection has about a third of the bandwidth of a typical landline/wifi connection). OK, it's a third of the speed, but it's the same order of magnitude, and it only applies about 20% of the time.
What this means is that a mobile user is getting data at (100 * 0.8) + (33 * 0.2) = 86% bandwidth of a landline connection. This means that a 16% increase in landline bandwidth would be enough to balance out everyone moving to mobile devices. Landline bandwidth has of course improved a lot more than 16% in the last few years, and not everyone has moved to exclusively mobile device web-browsing. So yes, I think it's fair to say that the average bandwidth of web users has gone up, at least in France.
The overhead of TCP and HTTP make latency the limiting factor - see Mike Belshe's "More Bandwidth doesn't Matter (Much)" - http://www.belshe.com/2010/05/24/more-bandwidth-doesnt-matte...
High priority
Compressing the following resources with gzip could reduce their transfer size by 235.5KiB (72% reduction).
Compressing http://zoompf.com/js/jquery-ui.min.js could save 142.7KiB (74% reduction).
Compressing http://zoompf.com/js/jquery.min.js could save 62.5KiB (66% reduction).
Compressing http://zoompf.com/wp-content/themes/NewZoompf/style.css could save 24.9KiB (77% reduction).
Compressing http://zoompf.com/js/animations.js could save 4.0KiB (75% reduction).
Compressing http://zoompf.com/.../wp-page-numbers.css could save 1.4KiB (73% reduction).
Medium Priority The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources:
http://zoompf.com/images/background_pages.png (expiration not specified)
http://zoompf.com/images/clipboard.png (expiration not specified)
http://zoompf.com/images/handles.png (expiration not specified)
http://zoompf.com/images/pages.png (expiration not specified)
http://zoompf.com/images/report.png (expiration not specified)
http://zoompf.com/images/streak.png (expiration not specified)
http://zoompf.com/js/animations.js (expiration not specified)
http://zoompf.com/js/jquery-ui.min.js (expiration not specified)
http://zoompf.com/js/jquery.min.js (expiration not specified)
http://zoompf.com/.../wp-page-numbers.css (expiration not specified)
http://zoompf.com/wp-content/themes/NewZoompf/style.css (expiration not specified)
http://zoompf.com/.../freedownload.jpg (expiration not specified)
http://zoompf.com/.../freeperformancescan.jpg (expiration not specified)
http://zoompf.com/.../logo-disrupt.jpg (expiration not specified)
http://zoompf.com/.../logo-virgin-america.png (expiration not specified)
http://zoompf.com/.../social-icons-32.png (expiration not specified)
http://zoompf.com/.../video-icon.png (expiration not specified)
They basically don't follow their own advice. Credibility -> toilet.edit: on further examination, the examples given in the wikipedia article are really bad - because they're merely pointing out hypocrisy ("but you're -foo-") rather than claiming the argument is wrong. Person 2 in each example could quite happily be in full agreement with the argument and make the same comment.
He literally wrote the book on it.
However, it is curious to discover they have quite hefty JS files loading in their own HEAD element.
http://www.webpagetest.org/result/121024_K0_78b60a17cae988da...
EDIT: Actually, it is applying some concatenation, but it's not concatenating everything: http://www.webpagetest.org/result/121024_35_049258ec5056f5b4...
Betty:~ lelf$ dig www.apple.com
[…]
;; ANSWER SECTION:
www.apple.com. 1434 IN CNAME www.isg-apple.com.akadns.net.
www.isg-apple.com.akadns.net. 21 IN CNAME www.apple.com.edgekey.net.
www.apple.com.edgekey.net. 21234 IN CNAME e3191.c.akamaiedge.net.
e3191.c.akamaiedge.net. 20 IN A 23.32.109.15
[…]
(If you really don't understand: http://en.wikipedia.org/wiki/Akamai_Technologies http://en.wikipedia.org/wiki/Content_delivery_network)EDIT: formatting, links
- Response Time (how long does it take per task) - Throughput (how many tasks can we complete per N)
For some of us, getting better responses means in-and-out quicker and so its easier to serve more throughput. For apple, they have plenty of capacity, so new product launches aren't really a motivation to improve response. They will we able to support that volume anyway. The motivation would be to improve user experience.
My plea to web-admins: Try to at least make the names of the shards recognizable. I've seen sites where the domain is essentialy "mynewspaper.com" and it needs data from "xac1h139a.com" to display correctly. Now go find the right domain to allow within the dozens of cross site requests that such sites are often using...
Edit: This is a comment on his suggestion to use domain sharding. His site is fine.