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!
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 returnedHTTP/1.1
. So its not the savest way. But there is an env calledX_SPDY
which should beHTTP2
orQUIC
if the server supports http/2. If its empty, then its http/1(.1).