- πΉπΉTrinidad and Tobago xamount
Just an FYI, Cloudflare automatically does this by default. (not sure about other CDNs, but probably..)
See here: https://blog.cloudflare.com/early-hints/. (See section "Now: Turning 200 OK Link: headers into 103 Early Hints")
To summarise: Cloudflare will read your Link headers and push that through early hints via HTTP 103.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Looks like Symfony also gained some support for this since then: https://github.com/search?q=repo%3Asymfony%2Fsymfony+103+early+hint&type...
- πΊπΈUnited States kentr
Cloudflare doesn't exactly do this. What it does is send Early Hints for subsequent requests (emphasis mine):
Cloudflare takes these [Link] headers and caches them at our edge, ready to be served as a 103 Early Hints payload.
When subsequent requests come for that asset, we immediately send the browser the cached Early Hints response while proxying the request to the origin server to generate the full response.So the first response through Cloudflare doesn't have the Early Hints headers (as the first response would if Early Hints were served directly by Drupal). But it's better than what we have now, and the Cloudflare cache can be warmed if needed.
As of April 2023 only FrankenPHP supports early hints headers, according to the Symfony blog.
A comment on that post points out a PR to add Early Hints to standard PHP.
However, PHP should currently be able to add
Link
headers withpreload
orpreconnect
.They would be there to be picked up by Cloudflare and other proxies, and may add small gains even without Early Hints.
A benefit of specifying
preload
in the HTTP Header is that the browser doesn't need to parse the document to discover it, which can offer small improvements in some cases. - π«π·France andypost
If core will support FrankenPHP there's built-in support for it https://frankenphp.dev/docs/early-hints/
- π©πͺGermany IT-Cru Munich
Since Symfony 6.3 there is an early hints integration available.