Archived topic
HTTP Server Push
3 replies · Started by Simon on May 16, 2019
Hey Tom,
Totally understand if this question is beyond the scope of things. So happy for you to just delete this post.
But any idea on how to implement server pushing on select CSS files? Cloudflare just says it as easy as adding this to the header, but no idea how to go about doing that and thought maybe you have done it before.
Link: </css/style.css>; rel=preload; as=style;, </css/style2.css>; rel=preload; as=style;
Cheers,
Simon
If you're using Cloudflare, it looks like you can do this with their plugin: https://support.cloudflare.com/hc/en-us/articles/115002816808-How-do-I-enable-HTTP-2-Server-Push-in-WordPress
Otherwise, it looks like wp_enqueue_style and wp_enqueue_script would need to be filtered to include those attributes.
Thanks Tommo,
I actually enabled that from the plugin, but it doubled up the files pushing them and serving them normally. Which seems a little pointless.
I'll see if i can find a dev to code up something to enqueue the attributes as you mentioned.
Thanks again.
Si
No problem :)