Servo

Nginx 1.13.9 已支持 HTTP/2 Server Push 。

  •  
  •   Servo · Feb 21, 2018 · 3574 views
    This topic created in 3083 days ago, the information mentioned may be changed or developed.

    详见:Introducing HTTP/2 Server Push with NGINX 1.13.9

    最简单的用法如下

    server {
        # Ensure that HTTP/2 is enabled for the server
        listen 443 ssl http2;
    
    
        ssl_certificate ssl/certificate.pem;
        ssl_certificate_key ssl/key.pem;
    
        root /var/www/html;
    
        # whenever a client requests demo.html, also push
        # /style.css, /image1.jpg and /image2.jpg
        location = /demo.html {
            http2_push /style.css;
            http2_push /image1.jpg;
            http2_push /image2.jpg;
        }
    }
    

    push

    HTTP/2 Server Push 意味着什么?

    push

    cdkey51
        1
    cdkey51  
       Feb 22, 2018 via iPhone
    支持一下 学习了
    carlhan
        2
    carlhan  
       Feb 22, 2018 via iPhone
    如果是用 webpack 打包出来的带 bundle hash 的 assets 要如何配置呢
    Servo
        3
    Servo  
    OP
       Feb 22, 2018 via Android
    @carlhan 简单点就手动添加后面的 hash,我试过是可行的,缺点是一修改资源就得修改 Nginx 配置。最好是使用内文中说的“ http2_push_preload ”,给资源 添加“ rel=preload ”标记。
    RobertYang
        4
    RobertYang  
       Feb 22, 2018 via Android
    昨晚已使用上了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1108 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 23:59 · PVG 07:59 · LAX 16:59 · JFK 19:59
    ♥ Do have faith in what you're doing.