0x2b - (I) don't use Google assets
Recently people are moving to google hosted Javascript APIs. Which sounds good, at the first sight, because
- your client's browser connect not only to your site, but to google as well to fetch needed assets, which might result in more parallel connections and a faster download time, and
- your client's browser might already have the google hosted assets in its cache.
However, I recently stopped doing this. Why?
Performance: Well, for once the performance of google hosted assets seemed not extremely good; a response time of ~400ms seems quite normal, at least for me here in Germany. And that is a response time I outperform myself with ease.
Parallelity: While the browser happily downloads Google's versions in parallel, this is easy to be done myself. Set up a "parallel" host - same source directory, different hostname - and use that as an asset host.
Custom assets: When I use, say, jquery, I usually not only use the basic thing, but a bunch of different plugins, and then of course I have my very own application javascript as well. If I let google deliver the base jquery plugin, then I still have to deliver the other stuff myself. Which means all of those Parallelity and Performane topics are back on my table.
Works offline: yes, it does. Comes in handy when working on a train.
Privacy issues: yes, google hosted assets do set a cookie. One can only speculate the reason behind this; but unless my customers agree into using Google Analytics I don't want them pestered with uninvited cookies.
My solution: asset bundling: Instead I bundle the assets myself. In the case of Javascript and CSS files this is easily done, by just concatenating these. I then embed my CSS files into the Javascript files (my web sites usually only work with javascript enabled anyways). This results in one hand tailored asset file, ready to be cached and delivered by myself.