HTTP Early Hints PoC #332
Replies: 5 comments 12 replies
-
Any estimates on merge? |
Beta Was this translation helpful? Give feedback.
-
Hi Roman! Thanks a lot for the great patch 🔥 We've been using your implementation in production on a high-traffic project — everything works smoothly, with no performance issues observed. For some specific needs, we built an extension based on your fork: README.early-hints.md Solid work, it was a pleasure to integrate. Thanks again! |
Beta Was this translation helpful? Give feedback.
-
Excellent feature! Does it work on the current HEAD (f354250)? Not sure if there is a configuration error:
conf.d/base/header.conf:
Let me know if more configuration details are needed. Thanks for your excellent work! |
Beta Was this translation helpful? Give feedback.
-
I was beyond excited to see early hints in nginx! I've been waiting years for this, formerly an excited user of HTTP/2 Server Push before it got misused by developers and the browsers axed it. I must admit I was a bit devastated to find out that the ability to have nginx generate early hints was removed from the scope. I can respect working on the feature incrementally, but from my perspective we are still missing the most valuable and interesting part. If there's an open issue to track development on the ability for nginx to add early hints instead of just forwarding them as a proxy. Please let me know where I would very much like to subscribe to it. My use case is: A PHP FPM FastCGI backend. As far as I can tell, nearly all implementations of the FastCGI protocol have assumptions baked in that prevent HTTP 103 at that level. They assume one HTTP staus per request. (I'm not even certain the protocol allows something like 103 Early Hints to exist). I would like to have nginx send early_hints for CSS, images above the fold, and (if any) render blocking JavaScript to the browser, so it can start fetching those resources. Basically everything that's needed between receiving HTML and First Contentful Paint. So that the browser can fetch those resources in parallel while PHP does any server side work to generate the page. By doing both of these in parallel, a web page can load an entire RTT faster, for having the critical subresources ready before the HTML arrives. Right now if there's 100 ms of RTT, and 100ms of server side computation to render a page. A browser will take 300 ms to show the page the user. 100 ms for the initial request, 100 ms for server side computation, and 100 ms to fetch css, images, and blocking js. If nginx could send early hints, this same scenario could be reduced to 200 ms. 100 ms for the initial request, the browser receives the early hints from nginx, when it would otherwise be idle, and at the end of the server side computation instantly shows the page. This is a big difference for people accessing web sites hosted physically far away across the world. Allowing us reduce their page load times from (2x RTT + server processing time) to (1x RTT + server processing time). For people on the far side of the world (from the web server), with bad cellular or satellite internet. This is a huge difference in how fast a web page loads. From a semantic correctness standpoint, I think I'd prefer to specify Early Hints at the PHP layer, rather than the Nginx layer. I'm just not confident it can be done while conforming to the FastCGI spec. |
Beta Was this translation helpful? Give feedback.
-
I don't know if I'm doing something wrong, I've added the following to the top of my
And This has done absolutely nothing, I don't get the Early Hints showing on Chrome Dev Tools, testing my site here says No "Early Hints" has been found!. What am I missing? The blog post is saying a lot about this amazing feature but what else do I need to do to make it work? This is my entire
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In PR #326 we have a proof-of-concept implementation of HTTP Early Hints. We've been receiving multiple requests for this feature and now we are proud to share this PoC with the community. For anyone who's interested, please try it and report any feedback. This includes syntax, implementation issues, performance issues etc.
Beta Was this translation helpful? Give feedback.
All reactions