Comments (8)
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.
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.
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.
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.
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.
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.
A preconnect is not a fetch. Closing, feel free to open with new info.
from resource-timing.
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)
- Is nexthopprotocol different from that in the chrome devtools? HOT 1
- Problematic cases with cross-origin iframes & aborted navigations HOT 17
- User Agent may want to restrict cross-origin transferSize/encodedBodySize/decodedBodySize visibility even with TAO HOT 2
- Consider adding finalResponseHeaders{Start|End} times HOT 30
- InitiatorType for module scripts HOT 2
- Failed deploy HOT 3
- Specify the behaviors of requestStart and responseStart for Prefetch HOT 3
- Cache and Proxy information
- How to get correct connectStart/End, domainLookupStart/End value when service worker is enabled? HOT 8
- List of initiatorType types HOT 2
- Why is there noticeable gap between requestStart and connectEnd? HOT 1
- Should the spec mention "Queue entry" at somepoint? HOT 3
- Capturing basic auth credentials in URLs, part 2 HOT 1
- Test infrastructure to expose whether a browser intends to expose transferSize across origins with TAO HOT 10
- Adding HTTP method to ResourceTiming API structure HOT 5
- Adding resource discovery time to ResourceTiming API structure HOT 3
- Broken references in Resource Timing
- sendBeacon() integration HOT 4
- Resource Initiator Information Reporting HOT 2
- Expose Content-Encoding to ResourceTiming HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from resource-timing.