Welcome! Log In Create A New Profile

Advanced

103 Early Hints support in NGINX

Posted by elvinefendi 
103 Early Hints support in NGINX
December 10, 2021 03:45PM
HTTP/2 introduced a `push` feature that was supposed to improve page speed by pushing assets to the browser before it even requested it. But this feature never really worked because the server doesn't know what assets the browser already have in cache, so it often end up wastful. Ultimately Chrome recently announced they'll be removing support for it soon ([more context on this](https://evertpot.com/http-2-push-is-dead/)).

Now the new solution to this is 103 Early Hints: https://tools.ietf.org/html/rfc8297

Does NGINX have any plan to add support for 103 Early Hints header in response?

Current NGINX behaviour:

Apparently Nginx doesn't handle these response properly. It works well if I request it directly, but once Nginx is in the middle:

Using HTTP2:
```
$ curl -i https://early-hints-test.shopifycloud.com/
HTTP/2 103
date: Thu, 03 Dec 2020 15:45:18 GMT
link: https://example.com/script.js; rel=preload; as=script
strict-transport-security: max-age=63072000; includeSubDomains; preload
x-dc: gcp-us-central1

curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)
```

Forcing HTTP/1.1, it kinda works except it buffer the response for 20 seconds:

```
$ curl --http1.1 -i https://early-hints-test.shopifycloud.com/
HTTP/1.1 103 Early Hints
Date: Thu, 03 Dec 2020 15:38:46 GMT
Connection: keep-alive
Link: https://example.com/script.js; rel=preload; as=script
Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
X-Dc: gcp-us-central1

HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 259
```
Re: 103 Early Hints support in NGINX
August 29, 2022 12:04PM
Hi! Are there any updates?

Chrome is going to remove support for Server Push in version 106, it's already pretty soon https://developer.chrome.com/blog/removing-push/.
In this case, Early Hints is the only one that allows you to start downloading resources before the server responds.
Re: 103 Early Hints support in NGINX
December 19, 2022 04:57PM
Hi all!

We're laggards now! Crome removed HTTP/2 Server Push support and we lost about 30% page load time!
Pruflink: https://developer.chrome.com/blog/removing-push/

We need 103 Early Hints emergency!
Re: 103 Early Hints support in NGINX
June 12, 2023 12:16PM
"Early Hints" already supports Chrome and Edge - https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/103
There is an example implementation module "Early Hints" - https://github.com/flano-yuki/ngx_http_early_hints



Edited 1 time(s). Last edit at 06/12/2023 12:19PM by Helper code.
Re: 103 Early Hints support in NGINX
August 11, 2023 04:41PM
Can anyone suggest about NGINX plans for support (or not) for 103 Early Hints? Apache support this feature, but when NGINX on frontend, 103 headings from Apache has no effect!

Web developer, MODX CMS related projects OpenSource contributor, web perfomance expert.
Re: 103 Early Hints support in NGINX
August 12, 2023 08:28AM
dimasites Wrote:
-------------------------------------------------------
> Hi all!
>
> We're laggards now! Crome removed HTTP/2 Server Push support and we
> lost about 30% page load time!
> Pruflink: https://developer.chrome.com/blog/removing-push/
>
> We need 103 Early Hints emergency!

Loosing loadtime without Push or EH indicates a serious issue with your website(s), just like page-speed.

Water has always been water and does what water does, now that your addicted to Fanta (water+taste+sugar) all of a sudden water doesn't work for you anymore... Get over your addiction and deploy better services.

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: 103 Early Hints support in NGINX
August 12, 2023 04:00PM
@itpp2012 Thanks for the answer, but imho this is a not best comparison (or sarcasm?) ;-) I try to explain below.

My services do not have serious problems (98-100 points in mobile pagespeed test without Push or CH, but not without other cool and modern technologies), but this does not mean that I do not want to make them even better, because the loading time is far from 0 ms and new features in the protocols have been added to improve the situation, so why shouldn't I want to use them?

My job (and interest) is to make websites faster for UX and SEO and CH is a good tool (what was Server Push when used correctly). Now Push is gone, but it has a "replacement", and I see no reason to be retrograde and stay away.

If you want to give an analogy, then let it be not Fanta, but pigeon mail :). I'm not suggesting that you go back to using pigeon mail to send messages, because an email or this forum post is faster and more convenient.

So please do not suggest to me to pass by new achievements and technologies that make it possible to make the web server work better and faster. I also care about the speed of the application, but this is not the topic of the current discussion. Today we are talking about the fact that nginx is lagging behind in supporting the necessary technology!

What are we even talking about? The Web standard has been approved, all the arguments for and against have already been weighed by smart people. We need support from NGINX, which currently does not fully implement the standard.

The purpose of my messages is to focus attention on the fact that not everyone is suitable for using CDN and caching proxies, some of which can send 103 headers along the way. Moreover, one of the functions of nginx is a proxy! And he still doesn't know how to Early Hints!

I hope a fast web is waiting for us soon, but with or without nginx?



Edited 2 time(s). Last edit at 08/12/2023 04:03PM by dimasites.
Re: 103 Early Hints support in NGINX
June 28, 2024 09:39AM
itpp2012 Wrote:
-------------------------------------------------------
> dimasites Wrote:
> -------------------------------------------------------
> > Hi all!
> >
> > We're laggards now! Crome removed HTTP/2 Server Push support and we
> > lost about 30% page load time!
> > Pruflink: https://developer.chrome.com/blog/removing-push/
> >
> > We need 103 Early Hints emergency!
>
> Loosing loadtime without Push or EH indicates a serious issue with
> your website(s), just like page-speed.
>
> Water has always been water and does what water does, now that your
> addicted to Fanta (water+taste+sugar) all of a sudden water doesn't
> work for you anymore... Get over your addiction and deploy better
> services.

Do you mean better services like using another webserver?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 257
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready