Comment on Cdnjs - the missing cdnComments−pbreit15yPro tip: leave off the protocol to support both http and https. Example:<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>Source: http://html5boilerplate.com/−paulirish15ySecondary protip: use a DNS prefetch for even faster 3rd party asset delivery.<link rel="dns-prefetch" href="//cdnjs.cloudflare.com">More at: http://html5boilerplate.com/docs/#DNS-Prefetching−iamjustlooking15yIf you're loading the javascript on the same page you're surely going to see no benefit at all right?−paulirish15yThe browser can parallelize the DNS lookup, whereas running it serially and delaying the RTT for the asset will be much slower. So there is significant benefit to be had regardless. More: http://www.chromium.org/developers/design-documents/dns-pref...−iamjustlooking15yNeat trick! Thanks!−csulok15yprotocol relative URLs awesome, but be aware, because this is only good for scripts and images. stylesheets on such links are downloaded twice in internet explorer (http://www.stevesouders.com/blog/2010/02/10/5a-missing-schem...)
Comments
Pro tip: leave off the protocol to support both http and https. Example:
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
Source: http://html5boilerplate.com/
Secondary protip: use a DNS prefetch for even faster 3rd party asset delivery.
<link rel="dns-prefetch" href="//cdnjs.cloudflare.com">
More at: http://html5boilerplate.com/docs/#DNS-Prefetching
If you're loading the javascript on the same page you're surely going to see no benefit at all right?
The browser can parallelize the DNS lookup, whereas running it serially and delaying the RTT for the asset will be much slower. So there is significant benefit to be had regardless. More: http://www.chromium.org/developers/design-documents/dns-pref...
Neat trick! Thanks!
protocol relative URLs awesome, but be aware, because this is only good for scripts and images. stylesheets on such links are downloaded twice in internet explorer (http://www.stevesouders.com/blog/2010/02/10/5a-missing-schem...)