Determine best way to load client-side scripts
Created by: iainbryson
Right now, the Web site and the quiz use two distinct methods of loading clientside scripts: the quiz uses gems and the Web site uses bower and serves up the scripts statically.
Neither site uses CDNs, which I suspect is the best option. Possibly with a fallback to the local scripts if they fail (e.g. fallback.js).
We should perform an analysis to figure out what the fastest way of doing this is. My current assumptions are:
(1) CDNs are fastest, would relieve pressure from our servers and would be best for caching (2) Serving static files (like the Web site does) is second best. NGINX is better at serving static files than the Ruby thin or the rails infrastructure. And these files can also be gzipped for faster transport (3) Serving static clientside files from rails gems is the slowest (e.g. the Mathjax gem in used in the quiz).
The other thing going on is the asset pipeline; what (if anything) should be concatenated and minified together. Obviously this pushes in the opposite direction of the CDN, which keeps all the libraries separated.
In summary: we ought to test the performance of each of these methods to determine the best overall organization for speed (using Google PageSpeed and Yahoo YSlow)