Block rendering - inline JS and external JS

46 views
Skip to first unread message

Escondido

unread,
Dec 9, 2008, 5:46:19 PM12/9/08
to CS193H High Performance Web Sites
In addition to blocking parallel downloads, inline scripts block
rendering. When the Inline Scripts Block page is loaded, nothing in
the page is painted until the inline script is excuted. This is true
even if some plain text is in the HTML document BEFORE the inline
script, but the browser doesn’t render this until the inline script is
finished executing. I know that the normal external scripts block the
rendering. But my question is: do an external script only blocks
anything after it or like the inline scripts, they even block the
rendering before it?

Vibhor Nanavati

unread,
Dec 9, 2008, 9:23:49 PM12/9/08
to cs193...@googlegroups.com
My answer would be *No*.

Try this:
http://stevesouders.com/cuzillion/?c0=bi1hfff2_0&c1=bj1hfff2_2

In the cuzillion page above, I have an image followed by an external script.
The script is configured to take 2 seconds of download + 2 seconds of execution.

In the case I noticed (FF3 on ubuntu), there was progressive rendering to the point of script and then blocked for 4 seconds.
--
VIBHOR NANAVATI <vib...@stanford.edu>

Wuping Lu

unread,
Dec 9, 2008, 9:56:44 PM12/9/08
to cs193...@googlegroups.com
Thanks, Vibhor.
Reply all
Reply to author
Forward
0 new messages