Looking at the domains which contribute mostly towards dns-prefetch usage, Wordpress is the biggest contributor. I think by default Wordpress includes the snippet. *
<link rel=dns-prefetch href='//s.w.org'/>
or
<link rel=dns-prefetch href='//s0.wp.com'/>
<link rel=dns-prefetch href='//wordpress.com'/>
There is no preconnect
hint by default on Wordpress sites. (please correct me if mistaken).
The next most popular domain is related to Google Fonts. Google Fonts now (couldn’t find a date when this changed) recommends preconnect
.
Query:
#standardSQL
# Most popular hosts users dns-prefetch to
# capped to one hit per url to avoid having the results skewed by websites which dns-prefetch many resources from the same host
CREATE TEMPORARY FUNCTION getResourceHintsHrefs(payload STRING, hint STRING)
RETURNS ARRAY<STRING>
LANGUAGE js AS '''
try {
var $ = JSON.parse(payload);
var almanac = JSON.parse($._almanac);
return almanac['link-nodes'].nodes.filter(link => link.rel.toLowerCase() == hint).map(n => n.href);
} catch (e) {
return [];
}
''' ;
SELECT
client,
host,
freq,
total,
pct
FROM (
SELECT
client,
host,
COUNT(0) AS freq,
SUM(COUNT(0)) OVER (PARTITION BY client) AS total,
COUNT(0) / SUM(COUNT(0)) OVER (PARTITION BY client) AS pct,
ROW_NUMBER() OVER (PARTITION BY client ORDER BY COUNT(0) DESC) AS pos
FROM (
SELECT
client,
url,
host
FROM (
SELECT
_TABLE_SUFFIX AS client,
url,
NET.HOST(href) AS host
FROM
`httparchive.pages.2021_07_01_*`,
UNNEST(getResourceHintsHrefs(payload, "dns-prefetch")) AS href
)
GROUP BY
client,
url,
host
)
GROUP BY
client,
host
ORDER BY
client,
freq DESC
)
WHERE pos <= 100
When looking at the numbers, keep in mind that Wordpress makes up around 25% of origins in HA.
EDIT (2021-11-12): * The s.w.org domain is the CDN for serving emoji SVG images (provided by Twemoji) when WordPress detects (via its inlined emoji-loader.js) that the browser doesn’t support native emoji characters. This CDN has been used since WordPress 4.6. Source