How to enable http2 server push on nginx wordpress

I followed this tutorial but not working


server {

listen 80; listen 443 ssl http2;

      ssl_certificate         /etc/nginx/ssl/;
      ssl_certificate_key     /etc/nginx/ssl/;

root /var/www/html/;

http2_push_preload on;

index index.php index.html index.htm;

server_name *;

location / { try_files $uri $uri/ /index.php?$args; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~ .php$ { include snippets/fastcgi-php.conf; fastcgi_pass; }


verified by command line & chrome dev tools but not working.

its a Cloudflare shared ssl,

nghttp -ans

Interesting will try it replicating it.

If you website is running under cloudflare, you do not need to configure nginx on your side, because assets should be pushed by cloudflare

cloudflare doesn’t serve all requests.

70% requests pass through the origin server. for that, i have to configure my server. if i enable minify on Cloudflare. some requests its works some may not. (actually, i am not sure about this, installed page speed mod that conflict with Cloudflare ).

if Cloudflare does all the things I don’t need optimize server.

cloudflare>> analytics

Requests Through Cloudflare Last 24 Hours Total Requests 91,158 Cached Requests 11,965 Uncached Requests 79,193

Total Bandwidth 1.99 GB Cached Bandwidth 546.53 MB Uncached Bandwidth 1.44 GB

curl -I

header displays cf-cache status miss or hit etc hit indicates served by Cloudflare


Uncached requests are not directly served from your server, requests are still processed by Cloudflare proxy.

i have ran some tests with Cloudflare and modpagespeed disabled

disabled minify on both Cloudflare and serverside and flushed caches too.

page speed insights and gtmetrix showed those are minified.

if the web page have 10 files img,css,js,html

Cloudflare not caching all missing at least 2 static resources.

google psi makes sometimes irrelevant results.

i haven’t confirmed about Cloudflare processing every request but

i set browser caching for 8 hours. every time that value not changed. also, cf cache status is always hit. But in google PSI it showing reduce server response time. (if it servers from Cloudflare there is no server delay) sometimes mixed results.

i am caching including html.

Cloudflare never caches HTML resources, only other assets.

I have enabled cache everything page rule with ttl of 2 hours in cloudflare.

My goal is reduce server response time which shows in Google pagespeed insights. Page loads 3-4seconds gtmetrix. But worrying about Google psi.

I thought there is a network performance issue. Tried to Know the Ethernet speed if digital ocean droplet. But speed is unknown. lshw -C network lshw *-network description: Ethernet interface product: Virtio network device vendor: Red Hat, Inc physical id: 3 bus info: pci@0000:00:03.0 logical name: eth0 version: 00 serial: 9a:bc:e6:b3:1c:85 width: 32 bits clock: 33MHz capabilities: msix bus_master cap_list rom ethernet physical configuration: autonegotiation=off broadcast=yes driver=virtio_net driverversion=1.0.0 latency=0 link=yes multicast=yes resources: irq:10 ioport:c0c0(size=32) memory:fd052000-fd052fff memory:fd000000-fd03ffff

Ran dstat command everything is ok.

Last 39days cpu @10% memory running @30%.

Is Profiling /load testing on production server good idea? I want to give up for few days.

How to know network speed in server?

Newrelic php response time is average 340ms.

But as per Google rule server response time should be less than 200ms.

if we use Cloudflare we need to install Cloudflare plugin

and this piece line to wp-config.php

wp-config.php file:


so I thought was enabling http2 automatically do this.

i think enabling server push on the local server with Cloudflare shared SSL may not works.

i want to enable Server push to reduce TTFB.

HPACK has been enabled for all Cloudflare customers using HTTP/2.

finally I have enabled with Cloudflare.

Same here. Right now my sites are fast enoughl but the server response time is still high.