Re: Need to: "preload" CSS and JS

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