External scripts and style sheets are blocking the HTML rendering until they are downloaded, parsed and executed.
So, adding the async="async" (or maybe defer="defer" can also help, I forget) attribute to external scripts should make them not block the rendering.
<script src="..." async="async"></script>
External style sheets must be added dynamically (using JavaScript) in order not to block rendering, or must be declared below the content (the content that you want to show before everything is loaded).
Note that you better have some (basic) inline CSS in the page, or else everything will show up completely not formatted until the CSS shows us, which may be really not nice for the user experience.
I would guess the first paint is there because the browser parses <html> (and such), which is a blank sheet when it does not have any other content.
On Wed, Sep 26, 2012 at 9:15 PM, Samar
<sama...@gmail.com> wrote:
I also see a paint event in timeline panel which highlights (on hover) all the visible area of webpage. This event is triggered at 1ms, the very beginning. Why a paint event is required if no data has been downloaded (Browser has not received any data in just 1ms)
On Wed, Sep 26,
2012 at 9:01 PM, Samar
<sama...@gmail.com> wrote:
Thanks for the explanation. I got it.
I want the browser to start displaying my page (may be just the first screen of the full page) as early as possible. Can you point me to some guidelines, article etc regarding how can we trick the browser to start displaying page even if full content (the html itself, css, scripts etc.) are not downloaded completely?
Thanks in advance.