The use of an OBJECT or IMG element to trigger caching of remote URL's
is a good idea; however, it suffers from one problem which is
undetectable by the library and has the potential to considerably
increase load times: Scripts that send no-cache headers will be
requested twice. Scripts without cache-control or expires headers can
be requested multiple times if the heuristic cache detection algorithm
triggers it. Moreover, hard-reloading a page may cause this to happen
regardless of cache headers (although I've not tested this). While
the benefits of pre-fetching may outweigh this concern (most un-
cacheable scripts are embedded using document.write() anyway and hard
reloads should be rare), it would seem wise to address this.
Internet Explorer provides the pre-fetching capabilities implemented
in ControlJS out-of-the-box through it's readyState property and
corresponding readystatechange event. Here's an example page that
shows how it works. This page implements a loadscripts() function
that asynchronously downloads an array of URL's but then executes them
in parallel. It does this by creating only one script element, relies
on the fact that IE will begin resource retrieval immediately upon
assignment of the src and identifies when the script has finished by
testing for the readyState property for a value of "loaded".
http://digital-fulcrum.com/executionorder/
It would require ControlJS maintain a reference to the actual script
object as opposed to just the URL so it would require some non-trivial
re-factoring; however, it would seem to be a worthwhile endeavour.