W3C home > Mailing lists > Public > public-html@w3.org > December 2010

Re: Need to: "preload" CSS and JS

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 20 Dec 2010 14:42:46 -0500
Message-ID: <4D0FB1B6.80203@mit.edu>
To: Aryeh Gregor <Simetrical+w3c@gmail.com>
CC: Kyle Simpson <getify@gmail.com>, public html <public-html@w3.org>
On 12/20/10 11:17 AM, Aryeh Gregor wrote:
>> Some time ago, I benchmarked (informally) the cache-load penalty by
>> comparing a script that was loaded via XHR and injected versus a script that
>> was loaded into cache and then re-requested. The XHR outperformed the
>> load-from-cache. I can't recall exactly the figures, but I think for a
>> medium-sized script (~75k) it was about 5% slower or something of that
>> order.
>
> This is an implementation detail.  There's no reason browsers couldn't
> make sure to cache different things in memory if it were useful to
> speed sites up.

Fwiw.... maybe they are.  Loading a script involves trips through the 
event loop, whereas dumping script text onto a page does not.  That 
could account for a 5% difference right there.

-Boris
Received on Monday, 20 December 2010 19:43:26 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:16:07 UTC