[whatwg] Proposal for separating script downloads and execution

Will Alexander serverherder+whatwg at gmail.com
Tue Feb 22 10:25:42 PST 2011


> On Thu, 2011-02-17 at 15:24 -0500, Boris Zbarsky wrote:
>
> 1)  If your script is no-cache, or max-age:0, does IE make a new
>    request for it for every <script> element?

For the most part this seems to be the case but there are two exceptions:
  a) Before a URL loads, if it's assigned to another script, only one
request is made.
  b) IE seems to always cache when  the Back button is used.

Right: http://digital-fulcrum.com/webperf/readystate-caching/load-then-exec/
Wrong: http://digital-fulcrum.com/webperf/readystate-caching/batch-load-then-exec/


> 2)  If you create a bunch of <script> elements and set src on them all
>    and the script returned is different on every GET, and then you run
>    them, do you see all the different scripts running?

Yes, except for the two cases mentioned above.

> 3)  If you do that experiment with 1,000 scripts all of which return
>    the same 50KB of data and none of which you insert, do you see
>    memory usage go up by 50MB?  Does this depend on whether the
>    requests can be satisfied from cache or not?

It seems memory usage climbs with the number of
loaded-but-not-executed scripts, regardless of the caching state of
the URL, and declines as they are attached.

IE < 9 may mitigate this to some degree by enforcing its standard
garbage collection rules. If only circular references to the script
element exist, IE will abort the network request and never fire the
readystatechange event.

(function(){
   var s= create('script');
   s.src= ....
   s.onreadystatechange= function(){addToDom(this);};
})();

http://digital-fulcrum.com/webperf/ieabort/fail/

Will



More information about the whatwg mailing list