• Allows the server to proactively push assets like stylesheets and images to the client without them needing to parse the HTML page and make subsequent requests • Done by pushing the assets into the client cache, avoiding the roundtrip necessary to pull them up once the client makes the request
R O N O US $url = 'https://http2.akamai.com/demo/tile-%d.png'; for ($i = 0; $i <= $numRequests; $i++) { $ch = curl_init(); $conf[CURLOPT_URL] = sprintf($url, $i); curl_setopt($ch, CURLOPT_HTTP_VERSION, HTTP_VERSION_2_0); curl_exec($ch); curl_close($ch); }
R O N O US $url = 'https://http2.akamai.com/demo/tile-%d.png'; for ($i = 0; $i <= $numRequests; $i++) { $ch = curl_init(); $conf[CURLOPT_URL] = sprintf($url, $i); curl_setopt($ch, CURLOPT_HTTP_VERSION, HTTP_VERSION_2_0); curl_exec($ch); curl_close($ch); }
$i <= $numRequests; $i++) { $handles[] = $ch = curl_init(); $conf[CURLOPT_URL] = sprintf($url, ‘%d'); curl_multi_add_handle($mh, $ch); } H T T P/ 1 . 1 : CO N CU R R E N T
$i <= $numRequests; $i++) { $handles[] = $ch = curl_init(); $conf[CURLOPT_URL] = sprintf($url, ‘%d'); curl_multi_add_handle($mh, $ch); } H T T P/ 1 . 1 : CO N CU R R E N T
$i <= $numRequests; $i++) { $handles[] = $ch = curl_init(); $conf[CURLOPT_URL] = sprintf($url, ‘%d'); curl_multi_add_handle($mh, $ch); } H T T P/ 1 . 1 : CO N CU R R E N T
$i <= $numRequests; $i++) { $handles[] = $ch = curl_init(); $conf[CURLOPT_URL] = sprintf($url, ‘%d'); curl_multi_add_handle($mh, $ch); } H T T P/ 1 . 1 : CO N CU R R E N T
CU R R E N T ( CO N T. ) do { $exec = curl_multi_exec($mh, $running); } while ($exec == CURLM_CALL_MULTI_PERFORM); while ($running && $exec == CURLM_OK) { $ready = curl_multi_select($mh); if ($ready != -1) { do { $exec = curl_multi_exec($mh, $running); } while ($exec == CURLM_CALL_MULTI_PERFORM); } }
$i++) { $handles[] = $ch = curl_init(); $conf[CURLOPT_URL] = sprintf($url, ‘%d'); curl_multi_add_handle($mh, $ch); } H T T P/ 2 : M U LT I P L E X E D $mh = curl_multi_init();
$i++) { $handles[] = $ch = curl_init(); $conf[CURLOPT_URL] = sprintf($url, ‘%d'); curl_multi_add_handle($mh, $ch); } H T T P/ 2 : M U LT I P L E X E D curl_multi_setopt($mh, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX ); $mh = curl_multi_init();
P L E X E D ( CO N T. ) do { $exec = curl_multi_exec($mh, $running); } while ($exec == CURLM_CALL_MULTI_PERFORM); while ($running && $exec == CURLM_OK) { $ready = curl_multi_select($mh); if ($ready != -1) { do { $exec = curl_multi_exec($mh, $running); } while ($exec == CURLM_CALL_MULTI_PERFORM); } }