Earlier quoted context omitted.
"that are known to be needed by the currently transferred document" How does the server knows what the browser/client "needs" ? The client can have the cached stylesheet already. Making the server "in control" seems wrong and make things even more complicated.
The client can cancel the push. But yes, there's definitely wasted bandwidth here - the reason to still do it is that connections are now fast enough that the extra download time is small compared to the time required to parse HTML/send new HTTP request/receive response/render CSS.
Nginx-1.14.0 stable version has been released
31–40 of 68 posts
Re: Nginx-1.14.0 stable version has been released
#32>http2_push /static/css/main.css; Silly question, but what's the use case for the HTTP/2 Push? Their example with pushing doesn't make sense to me. Why would you want to push static content?
- Request index.html
- Parse index.html
- Request .js and .css and .jpg/png, etc found inside
- Parse .js and .css found inside
- Request additional .js, .css and .jpg/png, etc found within js/css
- Parse....
Into this...
- Request index.html, .css, .js, *.jpg/png
- Parse all
To avoid multiple round trips and improve initial page load time if you "know" what's going to be requested from the beginning.
Re: Nginx-1.14.0 stable version has been released
#33>http2_push /static/css/main.css; Silly question, but what's the use case for the HTTP/2 Push? Their example with pushing doesn't make sense to me. Why would you want to push static content?
It's a way to preemptively send assets to the client before they request them.
Re: Nginx-1.14.0 stable version has been released
#34Earlier quoted context omitted.
In 2016, the Chromium team at Google produced a document [1] that examines usecases for HTTP/2 Push, talks about deployment models, and analyzes whether it's worth it. In this particular case, you'd push static content because you know it will be needed later, and this way the information arrives in the HTTP header instead of in the payload's content body, so by the time 'main.css' is needed, the UA's HTTP cache may…
Pushes are probably best implemented in a caching layer, not manually describing what to push. A web server should not just cache resources, but also learn what kind of resources are often requested with each page and just push those next time someone makes a request. And some sort of push prediction policy should be configurable.
Nginx does have a module [1] and a corresponding configuration option to scan outgoing headers for Link header preload directives, and once it has learned of a preload being declared by a resource, it will push that resource thereafter. Nginx talks about the justification for this feature, where they too admit that statically configuring pushes in the server config is not terribly useful -- it's quite often the wrong place to specify relationships between resources.
[1] https://www.nginx.com/blog/nginx-1-13-9-http2-server-push/
Re: Nginx-1.14.0 stable version has been released
#35The reason I ask is that I see a lot of people build this themselves and run it from docker. I am concerned that they are not getting the various libc protections that should be enabled on internet facing daemons. i.e. stack-protector, fortify source, full relro, pie, ssp buffer limits, etc..
Re: Nginx-1.14.0 stable version has been released
#36Earlier quoted context omitted.
The client can cancel the push. But yes, there's definitely wasted bandwidth here - the reason to still do it is that connections are now fast enough that the extra download time is small compared to the time required to parse HTML/send new HTTP request/receive response/render CSS.
That's a very Silicon Valley way to look at things. How much does that bandwidth cost on dial-up or 2G?
Re: Nginx-1.14.0 stable version has been released
#37Earlier quoted context omitted.
It's a way to preemptively send assets to the client before they request them.
Pretty much the same effect is granted to any HTTP version by simply including stylesheets or scripts verbatim into the HTML.
Re: Nginx-1.14.0 stable version has been released
#38Earlier quoted context omitted.
I think there's a common misconception with the term "push". HTTP2 doesn't push in terms of a push notification, but rather "pushes" assets down the connection that are known to be needed by the currently transferred document (whatever that may be). That way, the web server can pro-actively push the named stylesheet to the client as it knows that the stylesheet is needed to render the page. That way the client doesn'…
"that are known to be needed by the currently transferred document" How does the server knows what the browser/client "needs" ? The client can have the cached stylesheet already. Making the server "in control" seems wrong and make things even more complicated.
There is however a small standard that's emerging, pioneered by h2o, called casper (https://h2o.examp1e.net/configure/http2_directives.html#http...). The idea is that all resources ever sent to the client are stored in a probabilistic data structure in a cookie. On every request the structure is sent back to the server, which can then check whether the resource has good chances to be already known by the browser.
By the way there are some benchmarks done by h2o's author here: http://blog.kazuhooku.com/2015/10/performance-of-http2-push-.... The conclusion is all yours.
Re: Nginx-1.14.0 stable version has been released
#39Earlier quoted context omitted.
I think there's a common misconception with the term "push". HTTP2 doesn't push in terms of a push notification, but rather "pushes" assets down the connection that are known to be needed by the currently transferred document (whatever that may be). That way, the web server can pro-actively push the named stylesheet to the client as it knows that the stylesheet is needed to render the page. That way the client doesn'…
"that are known to be needed by the currently transferred document" How does the server knows what the browser/client "needs" ? The client can have the cached stylesheet already. Making the server "in control" seems wrong and make things even more complicated.