Part | Chapter | Authors | Reviewers | Analysts | Metrics | Analysis
-- | -- | -- | -- | -- | -- | --
IV. Content Distribution | 19. Resource Hints | @khempenius | @andydavies @addyosmani @bazzadp @yoavweiss | @rviscomi | #21 | #100
Refer to the Authors' Guide for writing advice.
Checking in. Let me know if you have any questions about the results. If not we can check off the first item.
👋 Greetings! Just checking in again to make sure this is progressing and remind you of the October 7 deadline timed so we can launch at Chrome Dev Summit.
The checklist above indicates that you still need to review the results, write content, and get it reviewed. Feel free to reach out if you have any questions about the process.
🛎 just a ping to see if any progress has been made on this. Let me know!
Starting a doc for this.
@khempenius , @yoavweiss , @rviscomi did you consider measuring meta tag usage versus HTTP headers?
This is especially important as many HTTP/2 implementations take the HTTP preload header as a signal to push, but do not do the same for the meta preload tag. Will have a look and see if I can see the relative usage of each based on the queries created for this and my chapter on HTTP/2, but might be a more general interesting stat for this chapter.
Initial draft
@bazzadp It looks like the data set for this chapter looks only at usage w/ <link> tags.
Sorry just catching up on this now. I must have totally neglected headers from my analysis. It sounds like this is a significant omission so I'll try to find time to go back and include them.
@khempenius @yoavweiss @bazzadp how do you want to see this data added to the results? Totally new metrics that are header-specific or update all existing metrics to be "header OR markup"? If the latter, is it ok that we lose the ability to distinguish which approach sites are using?
Personally I’d like to know if this is even worth talking about :-) Can we run a quick stat to see how many HTTP link headers are used broken down by type? I suspect that it will be very light compared to HTML headers but that’s not based on anything other than gut feel and personal experience of it being easier to add to HTML so more likely used - hence why I’d like to know.
If usage is low in comparison, then one stat explaining which HTTP ones are used and volume compared to HTML might be sufficient - and that HTTP ones will be ignored for the rest of the chapter since usage is so small.
If not, and they do form a significant volume compared to HTML resource hints then it requires more thought and yes ideally would include in all stats.
The one exception to this might be preload as used for HTTP/2 push but as per the analysis for chapter 20 that looks like very light usage anyway so even that might be small.
Looking only at Link headers on HTML pages:
#standardSQL
CREATE TEMPORARY FUNCTION getResourceHints(payload STRING)
RETURNS STRUCT<preload BOOLEAN, prefetch BOOLEAN, preconnect BOOLEAN, prerender BOOLEAN, `dns-prefetch` BOOLEAN>
LANGUAGE js AS '''
var hints = ['preload', 'prefetch', 'preconnect', 'prerender', 'dns-prefetch'];
var re = new RegExp(`(${hints.map(hint => `\\\\b${hint}\\\\b`).join('|')})`, 'ig');
try {
var $ = JSON.parse(payload);
return $.response.headers.filter(({name, value}) => name.toLowerCase() == 'link' && re.test(value)).reduce((results, {name, value}) => {
var hint = value.match(re)[0].toLowerCase();
results[hint] = true;
return results;
}, {});
} catch (e) {
return hints.reduce((results, hint) => {
results[hint] = false;
return results;
}, {});
}
''';
SELECT
client,
COUNTIF(hints.preload) AS preload,
ROUND(COUNTIF(hints.preload) * 100 / COUNT(0), 2) AS pct_preload,
COUNTIF(hints.prefetch) AS prefetch,
ROUND(COUNTIF(hints.prefetch) * 100 / COUNT(0), 2) AS pct_prefetch,
COUNTIF(hints.preconnect) AS preconnect,
ROUND(COUNTIF(hints.preconnect) * 100 / COUNT(0), 2) AS pct_preconnect,
COUNTIF(hints.prerender) AS prerender,
ROUND(COUNTIF(hints.prerender) * 100 / COUNT(0), 2) AS pct_prerender,
COUNTIF(hints.`dns-prefetch`) AS dns_prefetch,
ROUND(COUNTIF(hints.`dns-prefetch`) * 100 / COUNT(0), 2) AS pct_dns_prefetch
FROM (
SELECT
client,
getResourceHints(payload) AS hints
FROM
`httparchive.almanac.requests`
WHERE
firstHtml)
GROUP BY
client
 | mobile | desktop
-- | -- | --
preload | 42267 | 36197
pct_preload | 0.76 | 0.8
prefetch | 974 | 896
pct_prefetch | 0.02 | 0.02
preconnect | 53626 | 31409
pct_preconnect | 0.96 | 0.69
prerender | 1 | 1
pct_prerender | 0 | 0
dns_prefetch | 573 | 602
pct_dns_prefetch | 0.01 | 0.01
Preload and preconnect are both used on ~1% of pages.
Thanks for that. So as suspected reasonably small. Interesting that preconnect is used as much as preload (and in fact more on mobile)! Suggests it is intentional use of both as a resource hint, rather than just as a knock of consequence of HTTP/2 push.
Anyway I got the answer I was looking for. Will let @khempenius and @yoavweiss decide if they want to use this stat and/or want the others rerun. Personally I think it's worth a paragraph to discuss but, as per above, wouldn't bother rerunning the other stats for it.
Thanks for reviewing the results @bazzadp. Would you like to be added as a peer reviewer for this chapter?
+1 to what @bazzadp said. I'll go ahead and add a short paragraph to discuss this.
Thanks for reviewing the results @bazzadp. Would you like to be added as a peer reviewer for this chapter?
Sure, happy to help if you want another pair of eyes on this. Though looks like there are lots of experts involved in this already!
Great, added!
@khempenius @yoavweiss Just checking in. Is the draft finished and ready for review? Anything else you wanted to write about?
I don't have anything to add.
Ok thanks. @andydavies @addyosmani @bazzadp could you peer review the doc? @yoavweiss do you have anything else to add?
Requested access!
On Tue, 15 Oct 2019 at 17:03, Rick Viscomi notifications@github.com wrote:
Ok thanks. @andydavies https://github.com/andydavies @addyosmani
https://github.com/addyosmani @bazzadp https://github.com/bazzadp
could you peer review the doc
https://docs.google.com/document/d/1v19-ELAyM9JVr2cY0_CCGSm9ay3hTFOeivZCyEkYEWk/edit?usp=sharing?
@yoavweiss https://github.com/yoavweiss do you have anything else to
add?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/HTTPArchive/almanac.httparchive.org/issues/136?email_source=notifications&email_token=AADIILF4AVN2S2UJQL6YQOTQOXST7A5CNFSM4ITJW5FKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBJKFLA#issuecomment-542286508,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AADIILGUDFQQBA36JTMHYDTQOXST7ANCNFSM4ITJW5FA
.
Added some comments to the doc. Feel free to ignore! Or ping me if any questions on what I said.
I've finally finished responding to the initial comments and it just might no longer be the shortest chapter in the almanac :) Thank you @bazzadp, @andydavies, @rviscomi for taking a look - your feedback was super helpful.
Apologies for joining in so late... :/
I added a few comments and suggestions on the doc.
@rviscomi - you can remove me from the "authors" column as this chapter is all @khempenius
Most helpful comment
I've finally finished responding to the initial comments and it just might no longer be the shortest chapter in the almanac :) Thank you @bazzadp, @andydavies, @rviscomi for taking a look - your feedback was super helpful.