Discover Centmin Mod today
Register Now

Nginx Nginx - Support for HTTP/2 Server Push

Discussion in 'Nginx and PHP-FPM news & discussions' started by buik, Apr 29, 2016.

  1. buik

    buik “The best traveler is one without a camera.”

    2,027
    524
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,675
    Local Time:
    7:38 PM
    Just a few hours ago, CloudFlare announced there support for HTTP/2 Server Push.

    Seems as CloudFlare is using there own HTTP/2 Server Push module.
    As Nginx won't support it upstream. (CloudFlare is using a kind of Nginx mix (cloudflare-nginx)?)

    Does anyone have more information about HTTP/2 Server Push and Nginx?
    HTTP/2 Server Push and Nginx could speedup a site a lot, so I want to start as soon as possible.


    Thanks,
     
  2. eva2000

    eva2000 Administrator Staff Member

    54,864
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    4:38 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yeah i saw that announcement and was wondering myself as Nginx HTTP/2 module doesn't have server push support. So most likely it's Cloudflare's own hack/coding. Hopefully, they open source release the code too so centmin mod can have some of that action :D
     
  3. buik

    buik “The best traveler is one without a camera.”

    2,027
    524
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,675
    Local Time:
    7:38 PM
    I don't think that Cloudflare would contribute such a high profile feature to the Nginx project. (If it is indeed a nginx module)
    It is too valuable for them and for their benefit compared to competitors in the same market.
    Cloudfare's contribution to Nginx is primarily on Nginx and LUA CloudFlare Open Source

    In addition also don't expect a HTTP/2 Server Push from the Nginx team in the near feature.

    Owen Garrett Head of Products at Nginx wrote:
    'Server Push is a non-essential, optional part of an HTTP/2 implementation. We're considering it for a future release.'

    Maybe it will be release for their paid version only ?, that paid version differs more and more compared to the free version (feature wise) which is not good if you ask me.

    For myself: Server Push IMHO is one of the most exciting features of HTTP/2.
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,864
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    4:38 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    agreed.. fingers crossed though :D
     
  5. Revenge

    Revenge Active Member

    469
    93
    28
    Feb 21, 2016
    Portugal
    Ratings:
    +354
    Local Time:
    6:38 PM
    1.9.x
    10.1.x
    But for us to take advantage of that feature, our web software also needs to support it correct?
    In the case of this forum, i don't think xenforo supports it. Cloudflare says that a bad implementation can lead to a worser result.
     
  6. eva2000

    eva2000 Administrator Staff Member

    54,864
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    4:38 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    well it depends, for HTTP/2 server push you just need web server to support it and web browsers to support it. Then you need to add the appropriate Link preload header to your html or site headers (i.e. at nginx level)

    Announcing Support for HTTP/2 Server Push
    so
    Code (Text):
    add_header Link "</asset/to/push.js>; rel=\"preload\"";

    I've used HTTP/2 server push with H2O HTTP/2 web server and it's very nice and noticeable speed improvement when properly configured :)
     
  7. Revenge

    Revenge Active Member

    469
    93
    28
    Feb 21, 2016
    Portugal
    Ratings:
    +354
    Local Time:
    6:38 PM
    1.9.x
    10.1.x
    Hmm, thats a lot easier then.
    Are there any benchmarks for us to have a notion of the performance improvement it can give?
     
  8. eva2000

    eva2000 Administrator Staff Member

    54,864
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    4:38 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  9. eva2000

    eva2000 Administrator Staff Member

    54,864
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    4:38 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    FYI, ngx_pagespeed which is integrated into Centmin Mod Nginx and is used on this forum and centminmod.com site also have a feature that closely mimmicks server push for HTTP and HTTPS based page loads for prioritising critical css and ensuring css is served before js etc. So configured right nginx with ngx_pagespeed, essentially can do the same thing for both HTTP and HTTPS base pages in speeding up the perceived initial render time of pages :) Why else do you think centminmod.com site and this forum is as snappy as it is ;) :D

    Nginx PageSpeed - Benefits of ngx_pagespeed :cool:

    from this post https://community.centminmod.com/posts/5424/

    webpagetest.org test of ngx_pagespeed enabled vs disabled notice the visually complete, time to start render and speed index time differences :)

    upload_2016-4-30_0-20-32.png

    upload_2016-4-30_0-23-34.png
     
    Last edited: Apr 30, 2016
  10. buik

    buik “The best traveler is one without a camera.”

    2,027
    524
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,675
    Local Time:
    7:38 PM
    Thanks eva2000 for your testing work.

    Serverpush HTTP 2.0 enables the server to send multiple responses (in parallel) for a single client request.
    And Pagespeed speeds up your site and reduces page load time by automatically applying web performance best practices to pages and associated assets.

    Seems to me as 2 different strategies in order to optimize a website. I.e. to speed up the webserver (Server Push) or optimizing existing website sources.
    What's your opinion on this?
     
  11. eva2000

    eva2000 Administrator Staff Member

    54,864
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    4:38 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    They both speed up the perceived initial page render time in different but similar ways. Just ngx_pagespeed works on HTTP and HTTPS while HTTP/2 server push works only for HTTPS :)
     
  12. buik

    buik “The best traveler is one without a camera.”

    2,027
    524
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,675
    Local Time:
    7:38 PM
    John Graham-Cumming from Cloudflare wrote: We modified NGINX to support HTTP/2 Server Push.
    @eva2000 could you ask them for their HTTP/2 Server Push patch?

    Hopefully they make it open source, I don't think so but you never know.
     
  13. eva2000

    eva2000 Administrator Staff Member

    54,864
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    4:38 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    i doubt they'd release it as it seems to be an added selling point for Cloudflare's services heh
     
  14. buik

    buik “The best traveler is one without a camera.”

    2,027
    524
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,675
    Local Time:
    7:38 PM
    It is indeed an unique selling point to me.
    But you could always ask: )

    Nevertheless, I think it's weird, this difference between Cloudflare and Nginx about the same push module but with a whole different priority.

    Nginx.org is acting weird and strangely since the creation of there profit Nginx.com club.
    Varnish, the company which address there profit and non profit much more subtle.
    Nginx can learn a lot from these guys.
     
    Last edited: May 3, 2016
  15. eva2000

    eva2000 Administrator Staff Member

    54,864
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    4:38 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Well Cloudflare and Nginx.com need to address their revenues to maintain funding as there's no such thing as a free lunch really. So understandable :)
     
  16. Revenge

    Revenge Active Member

    469
    93
    28
    Feb 21, 2016
    Portugal
    Ratings:
    +354
    Local Time:
    6:38 PM
    1.9.x
    10.1.x
    We never know if Cloudflare is not paying Nginx to hold off that functionality for some months.
     
  17. buik

    buik “The best traveler is one without a camera.”

    2,027
    524
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,675
    Local Time:
    7:38 PM
    Hmm yes and no if you ask me.
    Cloudflare is a company right from the start.
    Nginx is not.

    A familiar story, a free open source program gets fame, they start up a commercial company with investors.

    Investors want profit so right from the beginning,
    they start to develop modules and functions only for the paid version.

    They don't give a rats ass about the open source community, partly as a result of open source which they have become so popular.
     
  18. eva2000

    eva2000 Administrator Staff Member

    54,864
    12,239
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,810
    Local Time:
    4:38 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    who knows :)
    some might see it that way, but the way i see it is big companies paying for nginx plus help fund development which eventually trickles down to nginx open source version. Of course some development is only retained in nginx plus :)

    Guess you get a different perspective when I myself am developing Centmin Mod LEMP stack which is also open source and probably needs more funding that it currently has if it wants to be around long term and develop and evolve :) :D
     
  19. Ahmad

    Ahmad Active Member

    209
    80
    28
    Apr 13, 2015
    Ratings:
    +150
    Local Time:
    7:38 PM
    1.9.9
    10.1.10
    I agree with eva. I love open-source but you'd need sponsors or a very good amount of donations to make it a priority. Those who work on nginx also need a solid income ;)
     
  20. buik

    buik “The best traveler is one without a camera.”

    2,027
    524
    113
    Apr 29, 2016
    Flanders
    Ratings:
    +1,675
    Local Time:
    7:38 PM
    Help fund development? 10 whole years Nginx cloud live without dying from not getting any lunch.
    I don't believe in a sudden dire need.

    Since there commercial department, they added fewer and fewer interesting features to the Nginx.org version .Everything that is interesting, has been paid.
    It has gone from a communist lunch to a capitalistic lunch :)continued with more than 50 $ million investments in Nginx.com. Its all about the money.

    + They never added features from plus to open source in the past. Nor they will in the feature if you ask me.