DNS Prefetch / Socket Preconnect

245 views
Skip to first unread message

Pat Meenan

unread,
May 20, 2011, 8:44:11 AM5/20/11
to http-archive-...@googlegroups.com
I'm running into an interesting problem trying to create HAR files from
Chrome captures. The HAR spec for the entries:timings assumes that a
given request is processed serially with DNS immediately followed by
socket connect which is then followed immediately by the request.

In the case of modern browsers (Chrome and IE9 at a minimum but I expect
the others will do it soon if they don't already), the DNS and socket
connections can be done speculatively and well ahead of actual requests.

The easy answer would be to not include the times in with the requests
or to put the speculative lookups/connects right at the beginning of the
request and just pretend that they happened right before the request.
Neither is really a good long-term answer. Whenever we tackle 1.3 can
we consider explicit start and durations for each of the components?

Thanks,

-Pat

Guy Podjarny

unread,
May 20, 2011, 9:50:10 AM5/20/11
to http-archive-...@googlegroups.com
Maybe we could add a notion of "idle time" in the timings of a single object?
This will let you capture all this information, and allows the rendering engine of the waterfall to decide whether to glue the pre-idle work (e.g. DNS resolution) to the request start for simplicity, or to show some long white/transparent bar for the idle time. 

Just a thought,
Guypo

Nathan

unread,
May 22, 2011, 6:14:06 PM5/22/11
to HTTP Archive Specification
What if rather than timings, the spec called for event timestamps?
That would make it easier to show speculative events occurring before
the user request for example, since you could easily sequence
everything. And you'd still be able to back into the duration between
any two events.

Nathan

Drit

unread,
Feb 26, 2013, 2:05:41 PM2/26/13
to http-archive-...@googlegroups.com
Was this issue ever resolved with the HAR spec? The majority of the browsers have implemented some sort of DNS Prefetch and/or TCP Preconnect but the HAR 1.2 spec does not handle this case. (and am not even sure if the Chrome Dev Tools show this in the network tab).

drit

Andy Davies

unread,
Feb 27, 2013, 8:36:16 AM2/27/13
to http-archive-...@googlegroups.com
On 26 February 2013 19:05, Drit <dritan...@gmail.com> wrote:
Was this issue ever resolved with the HAR spec? The majority of the browsers have implemented some sort of DNS Prefetch and/or TCP Preconnect but the HAR 1.2 spec does not handle this case. (and am not even sure if the Chrome Dev Tools show this in the network tab).

 
Don't believe so… the HAR spec is now under the w3c perf group with plans for a new revision (http://www.w3.org/wiki/Web_Performance/Charter#Milestones) but my impression is that forward progress is slow!

There's quite a few things in the current spec that need addressing (off the top of my head):

- DOM events - only have a single timestamp rather than start + end
- Network events - as you highlighted spec assumes they happen in a continuous sequence 
- dataURIs - spec is silent on their treatment, Chrome includes them other browsers don't (my view is Chrome is wrong)
- about:blank - spec is silent, as far as I can determine browsers should include them

I also can't remember what happens for a request that is made but the browser times out e.g. 3rd party SPOF

Cheers

Andy

Reply all
Reply to author
Forward
0 new messages