Http2需要PageSpeed模块吗?

时间:2017-05-24 07:46:00

标签: nginx ubuntu-16.04 http2 mod-pagespeed

我们使用ubuntu 14.04和nginx 1.6.2, 最近,为了使用http2,我将服务器从Ubuntu升级到16.04,nginx升级到1.10.0,效果非常好。

我测试用pagespeed模块(1.11.33.4)编译nginx,然后比较

  1. http2
  2. http2 +的PageSpeed
  3. 但我发现option2比option1慢( ex:option1:7s和option2:13~14s ), 我尝试以下设置:

    [Vue warn]: Error in created hook: "TypeError: __WEBPACK_IMPORTED_MODULE_0__modules_CookiesManager_js__.a.getCookie is not a function"
    

    或添加更多一行:

    pagespeed on;
    
    # Needs to exist and be writable by nginx.  Use tmpfs for best performance.
    pagespeed FileCachePath /var/ngx_pagespeed_cache;
    
    # Ensure requests for pagespeed optimized resources go to the pagespeed handler
    # and no extraneous headers get set.
    location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
      add_header "" "";
    }
    location ~ "^/pagespeed_static/" { }
    location ~ "^/ngx_pagespeed_beacon$" { }
    

    但两者都很慢,我的设置配置有问题吗?或者http2和pagespeed模块运行不正常?

1 个答案:

答案 0 :(得分:0)

尝试设置docs页面建议的值: https://modpagespeed.com/doc/https_support