Boost Fertility New Invention Ups Success Rates.pdf
Velocity EU: Give Responsive Design a Mobile Performance Boost
1. YEP, WEB ON MOBILE IS SLOW
August 18, 2010
John Arne Sæterås
Twitter: @jonarnes
Head of innovation at Mobiletech
http://www.slideshare.net/jonarnes/
@jonarnes - Velocity conf 2013
2. SLOW IS NOT COOL
...even less cool on mobile
100 ms faster:
1% increased revenue
For Q3 2013 that is
$17mill.
@jonarnes - Velocity conf 2013
1 sec delay:
2.8% drop in revenue
http://www.slideshare.net/stubbornella/designing-fast-websites-presentation
http://slideshare.net/markstanton/speed-matters
http://techcrunch.com/2013/10/24/amazon-reports-q3-sales-of-17-09b-up-24-but-records-second-straight-loss/?ncid=f
4. WHY IS MOBILE SLOWER?
• Processing Power
• Browser
• Battery Preserving Strategies
• Network Latency
• Available Bandwidth
• The Implementation
@jonarnes - Velocity conf 2013
5. No
t so
FUN-FACT
Loading apple.com consume 1.41% of battery
life.
12 - 4% in 8 mins of
web surfing
@jonarnes - Velocity conf 2013
http://www2012.wwwconference.org/proceedings/proceedings/p41.pdf
8. 1.6 MB
in 95 requests on average
4 %
9 %
5 %
3 %
17 %
Images
CSS
Other
63 %
Scripts
Flash
HTML
http://httparchive.org/
@jonarnes - Velocity conf 2013
9. 1.6 MB
in 95 requests on average
6,7
Seconds
download
time
• Avg. speed: 2Mbps (cisco)
• 1 Mbps = 0.12 MB/s
• 1.6 / 0.24 = 6,7s
@jonarnes - Velocity conf 2013
http://www.cisco.com/en/US/solutions/collateral/ns341/ns525/ns537/ns705/ns827/white_paper_c11-520862.html
10. 1.6 MB
in 95 requests on average
9,5
Seconds
latency in
total
• 100-200 ms pr roundtrip
• Depends....(DNS, pipelining,
concurrent TCP connections,
keep alive etc.)
@jonarnes - Velocity conf 2013
11. 1.6 MB
in 95 requests on average
10,6
Seconds
total
+ rendering time in the browser
+ server response time
• Wake up radio (one time)
• TCP and DNS (one time)
• 95 round trips (6 req pr conn.)
• Downloading 1.6 MB over 2Mbps
@jonarnes - Velocity conf 2013
Disclaimer: lots of assumptions in this calculation!
12. GOOGLE: 7.5 S.
*at the time, the average web site was 1,2MB. Minus the 2s wakeup, we’re in the ballpark.
13. SERVE A PAGE TO A
MOBILE DEVICE IN
LESS THAN 1 SECOND?
A great overview by Ilya Grigorik
bit.ly/mobile-barrier
@jonarnes - Velocity conf 2013
14. WHO CARES?
Telco Network
53,53 %
The users care!
Other
46,47 %
How users connect. Page views per connection
type. (Scandinavian Countries). Source:
Mobiletech
@jonarnes - Velocity conf 2013
15. WHY USERS CARE?
➜
European Vodafone
account roaming in US
@jonarnes - Velocity conf 2013
http://mobiforge.com/designing/blog/performance-money-part-1-end-users-wallet
16. SO, WHAT IS OUR CURRENT
APPROACH TO THIS?
@jonarnes - Velocity conf 2013
18. Same size
72 %
RESPONSIVE
WEB DESIGN
Doh...
Als
oa
bou
nu t th
HT mb e sa
er o
TP
me
req f
ues
ts
@jonarnes - Velocity conf 2013
Much smaller
6 %
Smaller
22 %
http://www.guypo.com/uncategorized/real-world-rwd-performance-take-2/
19. RWD IS A TECHNIQUE
Nothing wrong with the technique! It is brilliant!
@jonarnes - Velocity conf 2013
The famous Iceberg: @brad_frost
20. RWD != MOBILE FRIENDLY
but an important step in the right direction
@jonarnes - Velocity conf 2013
21. Load time: 2.36 s *
Size:
36.59 KB
@jonarnes - Velocity conf 2013
Load time: 9.07s *
Size:
288.14 KB
*) Load event fired. - More on how the built the new BBC News site: http://slidesha.re/14IYNOO
26. Ou
r ex
80
%o amp
le:
ff
Sh
loa 10,
6s
avi
dt
im
.g
ng
e of ive
2,1 s a
s
THE LAST 20%
will improve performance by 80%
@jonarnes - Velocity conf 2013
27. RW
D
When all you have is a hammer,
every problem looks like a nail
dev
@jonarnes - Velocity conf 2013
ice
o
rb
row
ser
28. HOW CAN WE
FIX THIS?
What can we do to help
front end developers make
use of server side stuff?
@jonarnes - Velocity conf 2013
33. PURPOSE OF RESS
• Eliminate “over downloading”
• Let the server do the work instead
of the browser
@jonarnes - Velocity conf 2013
34. RESS IN A NUT SHELL
• RWD provide a sensible default or fallback
• The server does the optimization
size
sset
uce a arkup
Red
ive m g
elect rvin
S
d se
A
orks
netw
cial
So
inify
M
zip
ache
C
etc.
@jonarnes - Velocity conf 2013
35. SOMETIMES IT MAKES SENSE .TOt MULTI-SERVE
..or a
least do lay
out adjustm
ents to
component
s on the pa
ge
@jonarnes - Velocity conf 2013
36. INGREDIENTS OF RESS
Hello, I know exactly how to make you shine!
Request/Response
Information about the
requesting device,
network, etc.
@jonarnes - Velocity conf 2013
37. NOT A CRIME!
82% of top 100 Alexa sites use
Device Detection
“
In the case of
Mashable, we also
detect the type of
device and change
the site’s behavior
accordingly.
”
@jonarnes - Velocity conf 2013
http://www.circleid.com/posts/20120111_analysis_of_server_side_mobile_web_detection/
http://mashable.com/2012/12/11/responsive-web-design/
38. THERE IS A DIFFERENCE
Feature Detection
var
appCache=
function()
{
return
!!window.applicationCache;
};
User-Agent sniffing
var
isiPhone
=
/iPhone/i.test(navigator.userAgent);
Device Detection
GET
http://ddr.demo.wew.io/c/dual_orientation
Using the User-Agent (++) as a key to look up in a data base.
@jonarnes - Velocity conf 2013
40. FEATURES OF A DDR
Nice place to store custom stuff
• “Business rules”
• Specifics to your site
Override feature detected features
• If a feature works, but not well enough to make it useable
• False positives (not a HUGE issue, but still)
Available server side too
• Adapt and optimize stuff before sending to client
@jonarnes - Velocity conf 2013
ion
ipt
scr ry
De ito
ice pos
ev e
D R
49. CSS OPTIMIZATION
Device Capabilities as Media Features
Se
er
rv
de
n
re
e
id
S
ng
ri
@media
(-‐wew-‐pointing-‐method:
touchscreen){
a
{
padding:
10px;
}
}
Removing overhead and excess styles
@media
all
and
(min-‐width:
1500px){
//removed
for
devices
where
1500px
is
impossible.
e.g.
iPhones
body{color:
green;}
}
Examples and documentation: https://github.com/whateverweb/CSS-processor
@jonarnes - Velocity conf 2013
57. PERFORMANCE FRONT END
STARTS WITH THE BACK END
Too much is left to the browser to figure out.
@jonarnes - Velocity conf 2013
58. THE RULES
1.Make Fewer HTTP Requests
2.Use a Content Delivery Network
3.Add an Expires Header
4.Gzip Components
5.Put Stylesheets at the Top
6.Put Scripts at the Bottom
7.Avoid CSS Expressions
8.Make JavaScript and CSS External
9.Reduce DNS Lookups
10.Minify JavaScript
11.Avoid Redirects
12.Remove Duplicate Scripts
13.Configure ETags
14.Make AJAX Cacheable
By Steve Souders: http://stevesouders.com/hpws/rules.php
@jonarnes - Velocity conf 2013
Most of these are
implemented
server side.
59. SUMMING UP
We...
developer
@jonarnes - Velocity conf 2013
...must do stuff
here...
server
...to
relieve...
internet
...and...
telco
network
...to make life
easier for...
device
...and...
browser
60. THANK YOU
?
John Arne Sæterås
twitter: @jonarnes
http://www.slideshare.net/jonarnes/
@jonarnes - Velocity conf 2013