by Andreas Lorer
„73% of mobile users said they've encountered a site that was too slow to load” — Akamai.com
„As a product manager you should know that speed is feature number one” — Larry Page, Google 2010
„We surveyed 3000 users about 17 key product drivers. They rated speed 2nd most important only after easy to find content.” — Patrick Hamann, The Guardian 2014
Performance optimizing: andreaslorer.de
Performance optimizing: andreaslorer.de
„Elements above the fold were seen more than elements below the fold: the 100 pixels just above the fold were viewed 102% more than the 100 pixels just below the fold.” — Amy Schade 2015
<meta name="viewport" content="user-scalable=no">
Most time is spend on the network
„describes the network duration between sending a package from A and receiving it on B”
„is the duration a package needs in the network to get from A to B and back.”
Generation | Data rate | Latency |
---|---|---|
2G | 100 - 400 Kbit/s | 300 - 1000 ms |
3G | 0,5 - 5 Mbit/s | 100 - 500 ms |
4G | 1 - 50 Mbit/s | < 100 ms |
„Mitte 2013 konnten 70% der deutschen Haushalte über LTE verfügen. E-Plus startete mit LTE im März 2014.” — Bundesnetzagentur 2014
Fetching a 40 Kilobyte file
Theoretical approach:
HTTP Components
Consinsts of 3 parts:
= Critical rendering path
The browser rendering process:
<!DOCTYPE html>
<meta charset="utf-8">
<title>Web Performance for mobile users</title>
<link href="assets/styles.css" rel="stylesheet" />
<script src="assets/script.js"></script>
<p> Hello world! </p>
<!DOCTYPE html>
<meta charset="utf-8">
<title>Web Performance for mobile users</title>
<link href="assets/styles.css" rel="stylesheet" />
<script src="assets/script.js"></script>
<p> Hello world! </p>
sitespeed.io -u http://andreaslorer.de/ -b firefox -d 0
Uses real devices:
Polyfill ¹: Picturefill
01 <link rel="stylesheet" href="picturefill.min.js">
02
03 <picture id="hero-image">
04 <!-- Large devices -->
05 <source srcset="someImg_lg.jpg" media="(min-width: 1367px)">
06 <!-- Medium devices -->
07 <source srcset="someImg_md.jpg" media="(min-width: 768px)">
08 <!-- Small devices -->
09 <source srcset="someImg_xs.jpg" media="(min-width: 300px)">
10 <!-- Fallback -->
11 <img srcset="fallback.jpg" alt="Some alt text">
12 </picture>
Measure throughout the project via google-spreadsheets