Increased TTFB after activating http2 server push by installing cloudflare wordpress plugin

Hi. I noticed that ttfb has increased to near 1.6 seconds after activating serverpush in wordpress with cloudflare plugin. any suggestion why this happened and how to fix it?
thanks

1 Like

How are you enabling HTTP/2 server push as it isn’t a one click toggle anywhere in Cloudflare dashboard or wordpress plugin as far as I know.

Also depends on what assets you HTTP/2 server push as you have to optimally select which assets to push so your visitors don’t end up competing for browser resources and bandwidth and thus slowing your page loading times!

HTTP/2 server push by itself is only great in theory and not in practice as HTTP/2 server push isn’t browser cache aware. I know Cloudflare’s HTTP/2 sever push isn’t browser cache aware. I usually make CF HTTP/2 server push browser cache aware using some conditional logic on my Nginx origin site see https://community.centminmod.com/threads/nginx-http-2-server-push-finally-supported.13986/. You do that by setting up an nginx cookie which is attached to visitor’s first visit. This then distinguishes first visit versus repeat visits. Then you only enable on Nginx origin server preload asset to activate CF HTTP/2 server push when the visitor’s first visit is detected (when there is no attached detection cookie). If the attached cookie is detected, it means it’s a visitor’s repeat visit so disable preload/HTTP/2 sever push for repeat visit as it’s more likely visitor’s browser cache already has the pushed asset. Serving an asset from visitor’s browser cache is faster than HTTP/2 server push for repeat/return visitors.

1 Like

For this - you’d need to share a webpagetest.org waterfall or something similar that shows what is happening when the TTFB is longer.

As @eva2000 mentioned, Server Push as a concept can actually slow down your page speed depending on what is pushed, how important it is to the page render and also whether the client has it cached or not. I would recommend testing again with Server Push disabled and comparing from there.

Also keep in mind that TTFB is not really a good measure of overall performance for your visitors - it’s better to look at some of the newer metrics such as Core Web Vitals:

2 Likes

Indeed webpagetest can be very useful. I wrote a guide on using WPT at https://community.centminmod.com/threads/how-to-use-webpagetest-org-for-page-load-speed-testing.13859/ too :slight_smile:

+1 for @hemati.next might also want to read Performance Tutorials - Google PageSpeed & Webpagetest.org though TTFB is key to all the Core Web Vital metrics as you’d not going to get a good FCP/LCP if your TTFB is very very high.

1 Like

Thank you @eva2000 . I enabled it based on this guide by cloudflare
https://support.cloudflare.com/hc/en-us/articles/115002816808-How-do-I-enable-HTTP-2-Server-Push-in-WordPress
I’m not technical to do it by the way you said. If it’s gonna be Inefficient I prefer to disable it. But thought maybe there is a simple way to solve this problem. However If there is a problem and It’s not common that the ttfb increase anyway.
But I checked and it seems that it’s browser cache aware. because in network tab in chrome dev tools it loads some resources from cache.

@simon Thanks but It’s not in my control what cloudflare plugin pushes and is it critical for page rendering or not. I’ll test with and without push server and tell you the result here.

The context in which I mentioned browser cache aware means if asset is in cache, do not preload/push the asset. Not that the asset is cached or not. Cloudflare HTTP/2 Server Push isn’t browser cache aware as it can’t conditionally disable server push for repeat/return visitors which already have the intended pushed asset in browser cache already.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.