Giter VIP home page Giter VIP logo

Comments (8)

bluesmoon avatar bluesmoon commented on July 17, 2024 5

IMO a link element (or header) that results in dns-prefetch, prefetch, preconnect or preload should show up as a separate entry in ResourceTiming with the appropriate initiatorType. Only the relevant timing fields will be set up.

For dns-prefetch and preconnect, the values apart from startTime should all be 0 unless Timing-Allow-Origin is set. This will, at the very least, give the site developer an indication that pre* happened on the page.

getEntriesByName("...") would return multiple entries if a pre* as well as a regular download happened, each would have the appropriate initiatorType.

from resource-timing.

yoavweiss avatar yoavweiss commented on July 17, 2024 1

That's a fairly indirect way of measuring the benefits. FWIW, I think that browser heuristic preconnects should also be exposed. Would enable interesting RUM analysis that may say "Site X is faster on browser Y because of the browser's preconnect heuristics" (which can enable site Y to add more preconnect directives to compensate for other browsers and enable other browsers to try and catch up)

from resource-timing.

igrigorik avatar igrigorik commented on July 17, 2024

See my comment on https://bugs.chromium.org/p/chromium/issues/detail?id=545936#c7

I don't think we should do anything special here. A preconnect has the same effect as reusing an existing connection; we should report zero's.

from resource-timing.

yoavweiss avatar yoavweiss commented on July 17, 2024

Maybe this doesn't belong at the current connect{Start,End} properties, but we need to address the "What is preconnect doing for my site for real users?" use case. Let's discuss in the F2F.

from resource-timing.

toddreifsteck avatar toddreifsteck commented on July 17, 2024

My expectation is a reduction in the resource timing's time spent in connect and TLS when preconnect is applied. This should be visible in A/B testing on 1st load of a freshly loaded browser on all platforms in all engines but PLT2 is likely to benefit from various engine's hinting mechanisms......

from resource-timing.

mhofman avatar mhofman commented on July 17, 2024

The problem with having it as a separate entry is that a dns-prefetch or a preconnect do not result in any way for the server to indicate a Timing-Allow-Origin. It would also make observable the fact that the browser actually complied with the hint.

The only way I can think of working around both these issues is to only insert the PerformanceEntry for the preconnect once it was used by an actual resource, and use the TAO info of that request to decide which information to include.

In our case, the lack of connection establishment timing for a fetch if a preconnect was used causes us to lose valuable telemetry.

from resource-timing.

noamr avatar noamr commented on July 17, 2024

A preconnect is not a fetch. Closing, feel free to open with new info.

from resource-timing.

yoavweiss avatar yoavweiss commented on July 17, 2024

Also, this was discussed at the WG's TPAC meetings, and there was consensus that this is not a required addition. So closing SGTM

from resource-timing.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.