Servo

Nginx 1.13.9 已支持 HTTP/2 Server Push 。

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