HTTP2 Header Compatibility with Older Browsers

I heard today that soon the http2 protocol will be implemented in modern browsers. Additional information: https://en.wikipedia.org/wiki/HTTP/2 , I know that Wikipedia is not the best resource, but it will give a little clue about what is happening. The question arises:


How will older browsers respond to http2 headers?

I mean on php ( http://php.net ) there is still (02.26.2015) a link in the header function ( http://php.net/manual/en/function.header.php ) to the specification http1.1( http: //www.faqs.org/rfcs/rfc2616 ). I understand that http2all I have to do is change the title, for example HTTP/1.1 404 Not Found, to something similar to HTTP/2.0 404 Not Found. But how do older browsers react to it? Is this transparent to webdevelopers and php encoders and implemented on the browser / server side, or are there some important things / compatibility tips?

Uses http2 headers right after they're ready for a good idea?

I don’t want to harm anyone, but I know such a browser that its name starts with leter I, and secondly, with a letter Ethat can go a little bad. I am afraid that the new specification will completely destroy the entire old version of this browser, and that it is http2. And we developers must write websites that just work, no matter where, and the magic http2will come true after millions of tons of fixes / updates / months of compatibility issues with older machines.


There should be some code in a well-formed question, so here it is :):

<?php
    header("HTTP/2.0 404 Not Found"); // Am I correct? It will look like this?
?>

What about older browsers in this case?

Is it a good idea to use it right after http2 is alive?


Additional documentation:

+4
1

HTTP/2, , HTTP/1.1 , Upgrade:, HTTP/2.

:

 GET / HTTP/1.1
 Host: server.example.com
 Connection: Upgrade, HTTP2-Settings
 Upgrade: h2c
 HTTP2-Settings: <base64url encoding of HTTP/2 SETTINGS payload>

: HTTP/2 draft 17, Sec 3.2

, - HTTP/1.1, , HTTP/2 . , HTTP/2, Upgrade: h2c HTTP2-Settings: ....

, HTTP/2, :

 HTTP/1.1 101 Switching Protocols
 Connection: Upgrade
 Upgrade: h2c
  
 PRI * HTTP/2.0
  
 SM
  
  

: HTTP/2 draft 17, Sec 3.2

, PRI *, " " HTTP/2. , HTTP/1.0 /1.1. , , , HTTP/2 (, ), HTTP/2 "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n" HTTP/1.1 400 Bad Request HTTP/1.X. ( HTTP/1.1 , .)

PHP HTTP/2 , header('HTTP/X.X...'). Saikyr , HTTP/2 - ; , HTTP/2 PHP.

. - - , : , HTTP/1.X. - . HPACK 12. ( , , HTTP , HTTP/2.)

, header("HTTP/2 404 Not Found"); - :

 \HTTP2::setHeader(':status','404'); 

header("Location: $PROTO://$HOST$PATH");

 \HTTP2::setHeader('location', "$PROTO://$HOST$PATH"); 

PHP, . , PHP Apache HTTP/2 . Apache PHP . , HTTP/1.1- , , , header() HTTP/2 ( , , , ).

HTTP/2 / HTTP/1.1 HTTP/2. Apache HTML , , PUSH_PROMISE GET.

HTTP/2 PHP , , "", , . CMS PHP , , .

, !

+10

All Articles