high performance web - full stack toronto

119
os.net Picture from Simon Howden freedigitalphotos.net high performance web Maximiliano Firtman @firt

Upload: maximiliano-firtman

Post on 15-Apr-2017

423 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: High Performance Web - Full Stack Toronto

Picture from Simon Howden freedigitalphotos.net!Picture from Simon Howden freedigitalphotos.net!

high performance

webMaximiliano Firtman

@firt

Page 2: High Performance Web - Full Stack Toronto

mobile+web developer & trainer

Page 3: High Performance Web - Full Stack Toronto
Page 4: High Performance Web - Full Stack Toronto

trainer

Page 5: High Performance Web - Full Stack Toronto
Page 6: High Performance Web - Full Stack Toronto

Original Books

Page 7: High Performance Web - Full Stack Toronto

Translations I don’t really understand

Page 8: High Performance Web - Full Stack Toronto
Page 9: High Performance Web - Full Stack Toronto

Let’s start with data

Page 10: High Performance Web - Full Stack Toronto

500ms delay, +26% user’s frustration

Source: Radware

:(

Page 11: High Performance Web - Full Stack Toronto

500ms delay, -20% Google’s traffic

1http://home.blarg.net/~glinden/StanfordDataMining.2006-11-29.ppt

:(

Page 12: High Performance Web - Full Stack Toronto

+100ms delay, -1% Amazon’s sales

1http://home.blarg.net/~glinden/StanfordDataMining.2006-11-29.ppt

:(

Page 13: High Performance Web - Full Stack Toronto

-2.2s page load, +15% downloads

Source: Firefox

:)

Page 14: High Performance Web - Full Stack Toronto

+60% faster, +14% donations ($$$)

Source: Obama Campaign

:)

Page 15: High Performance Web - Full Stack Toronto

Site speed in search rank

Screen shot of blog post

…we’ve decided to take site speed into account in our search rankings

googlewebmastercentral.blogspot.com/2010/04/using-site-speed-in-web-search-ranking.html

Page 16: High Performance Web - Full Stack Toronto

Web Performance

Optimization

Page 17: High Performance Web - Full Stack Toronto

where to optimize?

Page 18: High Performance Web - Full Stack Toronto

server frontend development

Page 19: High Performance Web - Full Stack Toronto

Top 100,000 sites

Page 20: High Performance Web - Full Stack Toronto

Perception and Goals

Page 21: High Performance Web - Full Stack Toronto

immediate feedback

100ms

Jakob Nielsen - Usability Engineering

Page 22: High Performance Web - Full Stack Toronto

losing user’s flow of

thoughts 1s

Jakob Nielsen - Usability Engineering

Page 23: High Performance Web - Full Stack Toronto

Source: Google Developers

RAIL

Page 24: High Performance Web - Full Stack Toronto

100ms

RAIL

Page 25: High Performance Web - Full Stack Toronto

100ms 16ms

RAIL

Page 26: High Performance Web - Full Stack Toronto

100ms 16ms 50ms

RAIL

Page 27: High Performance Web - Full Stack Toronto

100ms 16ms 50ms 1s

RAIL

Page 28: High Performance Web - Full Stack Toronto

The Web today

Page 29: High Performance Web - Full Stack Toronto

Desktop and Mobile

Page 30: High Performance Web - Full Stack Toronto

Chrome, Firefox, Edge, IE

Page 31: High Performance Web - Full Stack Toronto

iOS and Android

Page 32: High Performance Web - Full Stack Toronto

Safari and Chrome?

Page 33: High Performance Web - Full Stack Toronto

Browsers only?

Page 34: High Performance Web - Full Stack Toronto
Page 35: High Performance Web - Full Stack Toronto
Page 36: High Performance Web - Full Stack Toronto

web view browsing

Web View25%

Browser75%

Source: MOVR Report

Page 37: High Performance Web - Full Stack Toronto

Let’s see some data

Page 38: High Performance Web - Full Stack Toronto

Others 10%

iOS45%

Android45%

Page 39: High Performance Web - Full Stack Toronto

iOS45%

Safari100%?

Page 40: High Performance Web - Full Stack Toronto

Apps (WebView) 25%

Safari75%

iOS45%

Page 41: High Performance Web - Full Stack Toronto

Others 10%

iOS45%

Android45%

Page 42: High Performance Web - Full Stack Toronto

Android45%

Page 43: High Performance Web - Full Stack Toronto

Browser33%

Chrome67%

Android45%

Page 44: High Performance Web - Full Stack Toronto
Page 45: High Performance Web - Full Stack Toronto
Page 46: High Performance Web - Full Stack Toronto
Page 47: High Performance Web - Full Stack Toronto
Page 48: High Performance Web - Full Stack Toronto

Opera 3%

UC Browser 3%

BB 4%

Samsung 11%

Chrome37%

Safari42%

Page 49: High Performance Web - Full Stack Toronto

Cellular

Networks

Page 50: High Performance Web - Full Stack Toronto

4G is here! We shouldn’t worry about performance anymore...

(

)

Page 51: High Performance Web - Full Stack Toronto
Page 52: High Performance Web - Full Stack Toronto

50% of users are on 2G networks

Page 53: High Performance Web - Full Stack Toronto

only 21% has 4G Worldwide

Page 54: High Performance Web - Full Stack Toronto

~30% of the time 4G not used

Page 55: High Performance Web - Full Stack Toronto

Bandwidth (Mbps)

0 3.5 7 10.5 14

2G 3G Wifi 4G

Page 56: High Performance Web - Full Stack Toronto

2G

3G

4G

Home

0 250 500 750 1000

Min Max

Latency

Page 57: High Performance Web - Full Stack Toronto

2G

3G

4G

Home

0 250 500 750 1000

Min Max

Latency

Page 58: High Performance Web - Full Stack Toronto

latencyrequest

bandwidth

Page 59: High Performance Web - Full Stack Toronto

Responsive Web Design

Page 60: High Performance Web - Full Stack Toronto

Mobile websites are the past, right?

Page 61: High Performance Web - Full Stack Toronto
Page 62: High Performance Web - Full Stack Toronto
Page 63: High Performance Web - Full Stack Toronto

Responsive Web Design as a goal

Page 64: High Performance Web - Full Stack Toronto
Page 65: High Performance Web - Full Stack Toronto
Page 66: High Performance Web - Full Stack Toronto

who said that?

Page 67: High Performance Web - Full Stack Toronto

Your goal is more conversions

Page 68: High Performance Web - Full Stack Toronto

responsive -> +conversion?

Page 69: High Performance Web - Full Stack Toronto

Usability Speed Accessibility

Page 70: High Performance Web - Full Stack Toronto

RWD is a tool

Page 71: High Performance Web - Full Stack Toronto

RWD is not a goal

Page 72: High Performance Web - Full Stack Toronto

Wait! Google will penalize non-responsive websites…

(

)

Page 73: High Performance Web - Full Stack Toronto

Mmm…. NOT REALLY

Page 74: High Performance Web - Full Stack Toronto

RESPONSIVE WEB DESIGN

is the future

Page 75: High Performance Web - Full Stack Toronto

I’m not advocating for m.*

Page 76: High Performance Web - Full Stack Toronto
Page 77: High Performance Web - Full Stack Toronto

Don’t penalize your mobile users

Page 78: High Performance Web - Full Stack Toronto

Responsive Web Design is a GREAT TOOL

Page 79: High Performance Web - Full Stack Toronto
Page 80: High Performance Web - Full Stack Toronto
Page 81: High Performance Web - Full Stack Toronto

Show me how to perform better!

Page 82: High Performance Web - Full Stack Toronto

Basic Tips

Page 83: High Performance Web - Full Stack Toronto

Consider moving to HTTP/2

#PERFTIP TLS only

Page 84: High Performance Web - Full Stack Toronto

Reduce redirects

#PERFTIP

• Consume 100ms to 1s each • Social networks will use one

Page 85: High Performance Web - Full Stack Toronto

Remover App Banners

#PERFTIP

Page 86: High Performance Web - Full Stack Toronto
Page 87: High Performance Web - Full Stack Toronto

idontwantyourfuckingapp.tumblr.com

Page 88: High Performance Web - Full Stack Toronto

Avoid Client Side Rendering

• Reduces in 5x page load performance • Embrace plain HTML for initial loading

#PERFTIP

Page 89: High Performance Web - Full Stack Toronto

CSS as appetizer

#PERFTIP

Page 90: High Performance Web - Full Stack Toronto

JavaScript as dessert

#PERFTIP

• Use non-blocking JavaScript

Page 91: High Performance Web - Full Stack Toronto

Use Responsive Images

#PERFTIP

• Deliver the right image to the current device • srcset and <picture>

Page 92: High Performance Web - Full Stack Toronto
Page 93: High Performance Web - Full Stack Toronto

Use SVG

#PERFTIP

Page 94: High Performance Web - Full Stack Toronto

#PERFTIP

Page 95: High Performance Web - Full Stack Toronto

Careful with Web Fonts

#PERFTIP

Page 96: High Performance Web - Full Stack Toronto

Extreme tips

Page 97: High Performance Web - Full Stack Toronto

Load the page in 1 second

#PERFTIP

Page 98: High Performance Web - Full Stack Toronto

ATF content in 1 second

#PERFTIP

Page 99: High Performance Web - Full Stack Toronto

We need to separate ABOVE THE FOLD

(ATF)

Page 100: High Performance Web - Full Stack Toronto

ATF in 1 second

#PERFTIP

14Kb packet

Page 101: High Performance Web - Full Stack Toronto

#PERFTIP

14Kb packet • HTML, embedded CSS, embedded JavaScript

• Images?

Page 102: High Performance Web - Full Stack Toronto

Reevaluate RWD usage

#PERFTIP

Page 103: High Performance Web - Full Stack Toronto

Alternative compression

• Zopfli (over Gzip or deflate)

#PERFTIP

•+8% compression ratio

Page 104: High Performance Web - Full Stack Toronto

• Brotli +25% compression ratio

#PERFTIPTLS only

Alternative compression

Page 105: High Performance Web - Full Stack Toronto

Alternative Image Formats

• PNG with Zopfli (-8%) • WebP (-35%) • JPEG-HDR (-30%) • BPG (-50/-70%)

#PERFTIP

Page 106: High Performance Web - Full Stack Toronto

Service Workers

• Cache Storage API • Offline Experience • Immediate loading experience

#PERFTIP

Page 107: High Performance Web - Full Stack Toronto

Upgrading to a Progressive Web App

• Uses Service Workers • Performance is a key

#PERFTIP

Page 108: High Performance Web - Full Stack Toronto

AMP

Page 109: High Performance Web - Full Stack Toronto
Page 110: High Performance Web - Full Stack Toronto

AMP-HTML

Page 111: High Performance Web - Full Stack Toronto
Page 112: High Performance Web - Full Stack Toronto
Page 113: High Performance Web - Full Stack Toronto
Page 114: High Performance Web - Full Stack Toronto
Page 115: High Performance Web - Full Stack Toronto

Consider creating AMP content

• Alternative vs. Replacement • Where responsive comes?

#PERFTIP

Page 116: High Performance Web - Full Stack Toronto

Picture from Simon Howden freedigitalphotos.net!

uf! we've covered a

lot!

Page 117: High Performance Web - Full Stack Toronto

• Performance -> conversion • Perception Goals • Understanding Mobile • Basic Optimizations • Extreme Optimizations

Page 118: High Performance Web - Full Stack Toronto

oreilly.com/ideas/mobile-web-performance-checklist

Page 119: High Performance Web - Full Stack Toronto

Phoo from freefoto.com

[email protected]@firt

firt.mobi/hpmw