> Don’t forget that if you’re loading jQuery from a common CDN like Google’s or Microsoft’s, you’re likely introducing zero network latency as the browser will almost certainly have it cached already.
This claim is frequently made, but I’ve also seen many people express skepticism of it. The many different versions of jquery, and several different CDNs, combined with actual typical user behavior patterns, the limited cache capacity of some mobile environments, etc…. it MAY still be true, but I’d really want to see some evidence one way or another before assuming it either way.
It’s not an easy thing to measure though, because we are making claims about “most people’s browsers”, and there’s no easy way to measure other peoples browsers. But is anyone aware of anyone trying to approach it?
Why does it matter? If the "cached in most people's browsers" theory is true, then we would not want to concatenate JQuery into one big JS file (as the OP suggests), and we would not want to customize JQuery to include only the AMD modules actually used (as the OP hints at considering), as either one would prevent cache reuse accross sites.
Me, being skeptical of the theory, I still choose to concatenate (I think it's clearly the way to go), and would consider modular customization in the future if it were more convenient for development workflow or it was for a site where size/speed were an absolute priority.