See:
- https://www.ietf.org/proceedings/97/slides/slides-97-httpbis-sessb-early...
- http://lists.w3.org/Archives/Public/ietf-http-wg/2017JanMar/0485.html
- https://github.com/flano-yuki/ngx_http_early_hints
- https://mobile.twitter.com/icing/status/872480885068771328
- https://github.com/icing/mod_h2/releases/tag/v1.8.2
Comments
Comment #2
wim leersAnd apparently Apache's
mod_h2has supported this since November 2016!See https://mobile.twitter.com/icing/status/872480885068771328 + https://github.com/icing/mod_h2/releases/tag/v1.8.2.
Comment #3
wim leersThe spec was approved a few days ago: https://twitter.com/mnot/status/925135909737054208
https://datatracker.ietf.org/doc/draft-ietf-httpbis-early-hints/
Now we'll still need to wait for Symfony to support this. Using 103 early hint link headers requires support for streamed responses, which Symfony does not support. (This is also why BigPipe in Drupal core had to work around boatloads of Symfony limitations.)
And for now, it doesn't look like that will happen any time soon: https://github.com/symfony/symfony/search?utf8=%E2%9C%93&q=103+early+hin... …
Comment #4
wim leers>2 years have passed.
Still no support for this in
symfony/http-foundation.Comment #5
matt_paz commentedNot sure if this helps, but it looks like at least one part of this was addressed as part of symfony v4.3.5
https://github.com/symfony/symfony/pull/33391
Comment #6
wim leersOhhhhhh!!!!!!!!!! 🤩 Thank you, @matt_paz!
Comment #7
luksakI guess we could address this since the issues in Symphony have been fixed.
Comment #8
brooke_heaton commentedWould love to see this addressed. Thanks!
Comment #9
user654 commented.
Comment #10
xamountJust 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.
Comment #11
wim leersLooks like Symfony also gained some support for this since then: https://github.com/search?q=repo%3Asymfony%2Fsymfony+103+early+hint&type...
Comment #12
user654 commented.
Comment #13
kentr commentedCloudflare doesn't exactly do this. What it does is send Early Hints for subsequent requests (emphasis mine):
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
Linkheaders withpreloadorpreconnect.They would be there to be picked up by Cloudflare and other proxies, and may add small gains even without Early Hints.
Comment #14
andypostIf core will support FrankenPHP there's built-in support for it https://frankenphp.dev/docs/early-hints/
Comment #15
it-cruSince Symfony 6.3 there is an early hints integration available.
Comment #16
catchThere's a PHP PR here, although not much recent activity.
https://github.com/php/php-src/pull/7025