Our next event is on the 21st of May.
Speakers:
A short trip into the lower layers of networking and their implications for initial page load performance over mobile carriers. You will hear about RTT, congestion windows, chunked transfer encoding, how HTTP2 will help and how to utilise that knowledge when developing PHP applications served to mobile devices.
With all the bells and whistles of a CMS, we forget about simple, static HTML. In this talk reintroduce you to the concept of a static site, how to build one (using PHP of course) and deployment techniques to manage it. Examples include using sculpin, markdown, twig, CI and CDN's.
first content after ~4s
75% of users have stated that they'd never come back to a page they had to wait for for more than 4s
Google
loss of flow of thoughts occurs after 1s
Jakob Nielson Group
Our next event is on the 21st of May.
Speakers:
A short trip into the lower layers of networking and their implications for initial page load performance over mobile carriers. You will hear about RTT, congestion windows, chunked transfer encoding, how HTTP2 will help and how to utilise that knowledge when developing PHP applications served to mobile devices.
With all the bells and whistles of a CMS, we forget about simple, static HTML. In this talk reintroduce you to the concept of a static site, how to build one (using PHP of course) and deployment techniques to manage it. Examples include using sculpin, markdown, twig, CI and CDN's.
first content after ~1s
Our next event is on the 21st of May.
Speakers:
A short trip into the lower layers of networking and their implications for initial page load performance over mobile carriers. You will hear about RTT, congestion windows, chunked transfer encoding, how HTTP2 will help and how to utilise that knowledge when developing PHP applications served to mobile devices.
With all the bells and whistles of a CMS, we forget about simple, static HTML. In this talk reintroduce you to the concept of a static site, how to build one (using PHP of course) and deployment techniques to manage it. Examples include using sculpin, markdown, twig, CI and CDN's.
first content after ~1s
keeping the user entertained
network time = amount of data / bandwidth
relatively complex page ~ 30 KB
@ 5 Mbit/s = ~ 600 KB/s : ~ 0.05 seconds
@ 384 kbit/s = ~ 47 KB/s : ~ 0.65 seconds
doesn't explain 4+ seconds
maximum amount of data that can travel through the network in 1 second
the time it takes for a single bit of data to travel from client to server and back
NOT included in bandwidth metric
mobile average: 200ms
What does that mean for our mobile page?
But that's not all
200ms per Roundtrip
Congestion
more data enters the network than it can handle
Congestive Collapse
occurs, when due to resubmissions of unacknowledged packets the network can never recover
10 * 1460 b = 14600 b
How do we do that?
// emit a chunk
$content = ob_get_clean(); // get the content so far
$length = strlen($content); // calculate length
echo dechex($length) . "\r\n" // emit length in hex + CRLF
echo $content . "\r\n"; // emit content + CRLF
flush(); // flush to browser
ob_start(); // start a new buffer
// terminate the page with a 0-length chunk
echo '0' . "\r\n";
echo "\r\n";
<html>
<head>
<meta />
<!— … —>
<style>
/*
all styles we need for the initial page
BASE64 encoded images
*/
</style>
<script type=“text/javascript”>
/*
include initial js
*/
</script>
</head>
<body>
/* initial content */
<?php
// send first chunk
?>
/* keep processing */
</body>
</html>
// send terminating chunk