HTTP/2 Server Push On WP

Hi All,

I just want to push a few CSS files but after literally several days of searching, have been unable to find a way to impliment that on wordpress.

How are you guys implementing it and does anyone have it working with caching plugins like WPRocket.

Any help would be VERY appreciated.

Regards,
Simon

You can implement HTTP/2 Server Push in any site, WP or not, that is proxied by Cloudflare by just adding a properly formatted Link header:

https://support.cloudflare.com/hc/en-us/articles/218367338-HTTP-2-Server-Push

If you want to preload all CSS and JS files on a WordPress site, you can do so by installing and activating the Cloudflare Plugin, and adding a line of code to the wp-config.php file:

https://support.cloudflare.com/hc/en-us/articles/115002816808-How-do-I-enable-HTTP-2-Server-Push-in-WordPress

However, if your page has a large number of preloaded files, it may not render properly on Safari for iOS (my experience) and perhaps other browsers. This also may cause battery issues for mobile devices, so test it before final implementation.

2 Likes

Hey Floripare,

Thanks very much for your reply.

I tried to enable server push with the plugin, but i seemed to me it was delivering two version of the same files. One pushed the other not. I am guessing this has something to do with plugin caches… Maybe not.

Have not been able to find a work around for this as yet.

Cheers,
Simon

This topic was automatically closed after 30 days. New replies are no longer allowed.