apache / incubator-pagespeed-ngx

Automatic PageSpeed optimization module for Nginx
http://ngxpagespeed.com/
Apache License 2.0
4.37k stars 363 forks source link

server push not working while pagespeed is set to on #1545

Open aaronjorbin opened 6 years ago

aaronjorbin commented 6 years ago

Using http2_push_preload on for server push according to the instructions at https://www.nginx.com/blog/nginx-1-13-9-http2-server-push/#automatic-push works with pagespeed off, but turning it on (even with no additional pagespeed configuration) disables server push.

Here is some info on my setup.

nginx version: nginx/1.13.9
built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 
configure arguments: --add-module=/home/aaronjorbin/incubator-pagespeed-ngx-latest-stable --with-cc-opt='-
g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FOR
TIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -fPI
C' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/
access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-pa
th=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/
nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/ngi
nx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi
 --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-htt
p_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module -
-with-http_slice_module --with-threads --with-http_addition_module --with-http_geoip_module=dy
namic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module
=dynamic --with-http_sub_module --with-http_xslt_module=dynamic --with-stream=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module --with-mail=dynamic --with-mail_ssl_module
aaronjorbin commented 6 years ago

Apologies if this is a duplicate of #1539

berengerzyla commented 6 years ago

I have been scratching my head over this one too, and it's not a duplicate of #1539 .
Activating PageSpeed and disabling as many filters as possible still drops the Push under Nginx.
Even with a simple configuration as this one:

Version: 14: on

Filters
cw  Collapse Whitespace
hw  Flushes html
rc  Remove Comments

Options
  AvoidRenamingIntrospectiveJavascript (aris)  True
  BeaconUrl (bu)                               /ngx_pagespeed_beacon
  EnableCachePurge (euci)                      True
  EnableRewriting (e)                          1
  FetchHttps (fhs)                             enable
  FileCacheCleanIntervalMs (afcci)             3600000
  FileCacheInodeLimit (afcl)                   500000
  FileCachePath (afcp)                         /var/ngx_pagespeed_cache
  FileCacheSizeKb (afc)                        102400
  GlobalAdminPath (ngap)                       /pagespeed_global_admin
  HonorCsp (hcsp)                              True
  LogDir (ald)                                 /var/log/pagespeed
  MemcachedServers (ams)                       127.0.0.1:11211
  RespectVary (rv)                             True
  RewriteLevel (l)                             Pass Through
  Statistics (ase)                             True
  StatisticsLogging (asle)                     True

A Link-Preload header won't Push correctly under Nginx.
Add a PageSpeed=off to the parameters and the push will be there.

@aaronjorbin , did you find anything since March 10?

berengerzyla commented 6 years ago

Strange thing is even with all the filters deactivated, PageSpeed will try:
Trying to serve rewritten resource in-place: *path/to/my/pushed/ressource*

Note: my ressource is pushed but never called by the HTML, just for a test, and PageSpeed still tried to handle it.