Check server push support

227 views Asked by At

Is there a possibility to check via php if the server supports the http2 server-push feature?

I'd like to add server push support to a wordpress plugin. But the option should be disabled if the server does not support it. Maybe a JS solution could work as well..

Thanks!

1

There are 1 answers

0
Nico Martin On BEST ANSWER

It seems like its not possible to get supported html/2 features. But I found a way to check for http/2. $_SERVER['SERVER_PROTOCOL'] always returned HTTP/1.1. So its not the savest way. But there is an env called X_SPDY which should be HTTP2 or QUIC if the server supports http/2. If its empty, then its http/1(.1).