Slide 1

Slide 1 text

Upgrading the Web Driving Support For New Standards Velocity Santa Clara 2014 Jonathan Klein @jonathanklein

Slide 2

Slide 2 text

Slides, Links jkle.in/future

Slide 3

Slide 3 text

About Me

Slide 4

Slide 4 text

About Me • Performance Engineer At Etsy

Slide 5

Slide 5 text

About Me • Performance Engineer At Etsy • I write the Etsy Site Performance Reports

Slide 6

Slide 6 text

About Me • Performance Engineer At Etsy • I write the Etsy Site Performance Reports • Started Boston Web Perf Meetup Group

Slide 7

Slide 7 text

A Story

Slide 8

Slide 8 text

A Story From the Future

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

http://goo.gl/Uj3w9y

Slide 11

Slide 11 text

Things You Learned

Slide 12

Slide 12 text

Things You Learned • Origin Hints

Slide 13

Slide 13 text

Things You Learned • Origin Hints • Client Hints

Slide 14

Slide 14 text

Things You Learned • Origin Hints • Client Hints • WebP

Slide 15

Slide 15 text

Things You Learned • Origin Hints • Client Hints • WebP • SPDY/HTTP 2.0

Slide 16

Slide 16 text

Things You Learned • Origin Hints • Client Hints • WebP • SPDY/HTTP 2.0 • Pre-fetching

Slide 17

Slide 17 text

What Should I Implement?

Slide 18

Slide 18 text

Things You Learned • Origin Hints • Client Hints • WebP • SPDY/HTTP 2.0 • Pre-fetching

Slide 19

Slide 19 text

HTTP Origin Hints

Slide 20

Slide 20 text

HTTP Origin Hints • IETF Draft

Slide 21

Slide 21 text

HTTP Origin Hints • IETF Draft • HTTP Response Header

Slide 22

Slide 22 text

HTTP Origin Hints • IETF Draft • HTTP Response Header • Tells the browser about server capabilities

Slide 23

Slide 23 text

HTTP Origin Hints • IETF Draft • HTTP Response Header • Tells the browser about server capabilities •OH: a,b=6,c

Slide 24

Slide 24 text

HTTP Origin Hints

Slide 25

Slide 25 text

HTTP Origin Hints • Small Request Headers

Slide 26

Slide 26 text

HTTP Origin Hints • Small Request Headers • Relative Referers

Slide 27

Slide 27 text

HTTP Origin Hints • Small Request Headers • Relative Referers • Omitting Cookies

Slide 28

Slide 28 text

HTTP Origin Hints • Small Request Headers • Relative Referers • Omitting Cookies • Sharing Connections

Slide 29

Slide 29 text

HTTP Origin Hints • Small Request Headers • Relative Referers • Omitting Cookies • Sharing Connections • Pipeline Depth

Slide 30

Slide 30 text

Reduce Header Size

Slide 31

Slide 31 text

Optimize Transfer

Slide 32

Slide 32 text

No Content Changes

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

Things You Learned • Origin Hints • Client Hints • WebP • SPDY/HTTP 2.0 • Pre-fetching

Slide 35

Slide 35 text

Things You Learned • Origin Hints • Client Hints • WebP • SPDY/HTTP 2.0 • Pre-fetching

Slide 36

Slide 36 text

Client Hints

Slide 37

Slide 37 text

Client Hints • IETF Draft

Slide 38

Slide 38 text

Client Hints • IETF Draft • HTTP Request Header

Slide 39

Slide 39 text

Client Hints • IETF Draft • HTTP Request Header • Tells the server about browser capabilities

Slide 40

Slide 40 text

Client Hints • IETF Draft • HTTP Request Header • Tells the server about browser capabilities •CH-DPR: 2.0

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

Will Also Specify Height/Width

Slide 43

Slide 43 text

Simplifies Markup

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

Things You Learned • Origin Hints • Client Hints • WebP • SPDY/HTTP 2.0 • Pre-fetching

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

Things You Learned • Origin Hints • Client Hints • WebP • SPDY/HTTP 2.0 • Pre-fetching

Slide 48

Slide 48 text

WebP

Slide 49

Slide 49 text

WebP • New image format from Google

Slide 50

Slide 50 text

WebP • New image format from Google • 25-34% smaller than JPEG

Slide 51

Slide 51 text

WebP • New image format from Google • 25-34% smaller than JPEG • Lossless Option

Slide 52

Slide 52 text

WebP • New image format from Google • 25-34% smaller than JPEG • Lossless Option • Alpha Transparency

Slide 53

Slide 53 text

WebP • New image format from Google • 25-34% smaller than JPEG • Lossless Option • Alpha Transparency • Animation

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

Now We Are Getting Somewhere...

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

Key Stats First Run Bytes 576KB Start Render 932ms Speed Index 1269ms

Slide 59

Slide 59 text

Brief Aside: Speed Index

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

Convert JPEGs to WebP

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

Key Stats First Run WebP Difference Bytes 576KB 387KB -33% Start Render 932ms 1019ms +9% Speed Index 1269ms 1278ms <1%

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

Its Future is Uncertain

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

Challenges with WebP

Slide 68

Slide 68 text

Challenges with WebP • Harder to share

Slide 69

Slide 69 text

Challenges with WebP • Harder to share • Increased decoding time

Slide 70

Slide 70 text

Challenges with WebP • Harder to share • Increased decoding time • Controversial studies around quality/size

Slide 71

Slide 71 text

Challenges with WebP • Harder to share • Increased decoding time • Controversial studies around quality/size • No progressive decoding (yet)

Slide 72

Slide 72 text

Still a Big Bandwidth Win

Slide 73

Slide 73 text

Things You Learned • Origin Hints • Client Hints • WebP • SPDY/HTTP 2.0 • Pre-fetching

Slide 74

Slide 74 text

Things You Learned • Origin Hints • Client Hints • WebP • SPDY/HTTP 2.0 • Pre-fetching

Slide 75

Slide 75 text

SPDY/HTTP 2.0

Slide 76

Slide 76 text

SPDY/HTTP 2.0 • Next version of HTTP

Slide 77

Slide 77 text

SPDY/HTTP 2.0 • Next version of HTTP • HTTP Multiplexing

Slide 78

Slide 78 text

SPDY/HTTP 2.0 • Next version of HTTP • HTTP Multiplexing • Header Compression (HPACK)

Slide 79

Slide 79 text

SPDY/HTTP 2.0 • Next version of HTTP • HTTP Multiplexing • Header Compression (HPACK) • Prioritization

Slide 80

Slide 80 text

SPDY/HTTP 2.0 • Next version of HTTP • HTTP Multiplexing • Header Compression (HPACK) • Prioritization • Server Push

Slide 81

Slide 81 text

Recall Origin Hints…

Slide 82

Slide 82 text

Reducing Header Size vs. Header Compression

Slide 83

Slide 83 text

No content

Slide 84

Slide 84 text

No content

Slide 85

Slide 85 text

No More...

Slide 86

Slide 86 text

No More... • Domain Sharding

Slide 87

Slide 87 text

No More... • Domain Sharding • Spriting Images

Slide 88

Slide 88 text

No More... • Domain Sharding • Spriting Images • Concatenating Files

Slide 89

Slide 89 text

No More... • Domain Sharding • Spriting Images • Concatenating Files • DataURIs

Slide 90

Slide 90 text

No content

Slide 91

Slide 91 text

Slides, Links jkle.in/future

Slide 92

Slide 92 text

Let’s See it in Action

Slide 93

Slide 93 text

No content

Slide 94

Slide 94 text

No content

Slide 95

Slide 95 text

Before SPDY

Slide 96

Slide 96 text

After SPDY

Slide 97

Slide 97 text

Key Stats First Run SPDY/ HTTP 2.0 Difference Bytes 387KB 387KB - Start Render 1019ms 972ms -5% Speed Index 1278ms 1108ms -14%

Slide 98

Slide 98 text

No content

Slide 99

Slide 99 text

No content

Slide 100

Slide 100 text

Sites Using SPDY Today

Slide 101

Slide 101 text

Sites Using SPDY Today • Most (all?) Google Properties

Slide 102

Slide 102 text

Sites Using SPDY Today • Most (all?) Google Properties • Facebook

Slide 103

Slide 103 text

Sites Using SPDY Today • Most (all?) Google Properties • Facebook • Twitter

Slide 104

Slide 104 text

Sites Using SPDY Today • Most (all?) Google Properties • Facebook • Twitter • You?

Slide 105

Slide 105 text

Things You Learned • Origin Hints • Client Hints • WebP • SPDY/HTTP 2.0 • Pre-fetching

Slide 106

Slide 106 text

Things You Learned • Origin Hints • Client Hints • WebP • SPDY/HTTP 2.0 • Pre-fetching

Slide 107

Slide 107 text

NOT talking about pre-render

Slide 108

Slide 108 text

Pre-fetching • Fetch assets for next page • Speeds up navigation

Slide 109

Slide 109 text

WebPagetest Script ! logData 0 navigate https://velocity.jkle.in logData 1 navigate https://velocity.jkle.in/product.html

Slide 110

Slide 110 text

No content

Slide 111

Slide 111 text

Key Stats First Run Bytes 85KB Speed Index 479ms CSS Files 2 JS Files 6

Slide 112

Slide 112 text

! ! ! ! !

Slide 113

Slide 113 text

No content

Slide 114

Slide 114 text

Key Stats First Run Pre-fetching Difference Bytes 85KB 50KB -40% Speed Index 479ms 290ms -40% CSS Files 2 0 -100% JS Files 6 0 -100%

Slide 115

Slide 115 text

No content

Slide 116

Slide 116 text

Things You Learned • Origin Hints • Client Hints • WebP • SPDY/HTTP 2.0 • Pre-fetching

Slide 117

Slide 117 text

Browser Support

Slide 118

Slide 118 text

No content

Slide 119

Slide 119 text

These Are Still Good Options

Slide 120

Slide 120 text

Convincing CDNs Would Be HUGE

Slide 121

Slide 121 text

Implementation Challenges

Slide 122

Slide 122 text

Action Steps

Slide 123

Slide 123 text

Action Steps • Implement as much as you can

Slide 124

Slide 124 text

Action Steps • Implement as much as you can • Speak/blog about challenges

Slide 125

Slide 125 text

Action Steps • Implement as much as you can • Speak/blog about challenges • Ask your CDN for support

Slide 126

Slide 126 text

Action Steps • Implement as much as you can • Speak/blog about challenges • Ask your CDN for support • Report bugs

Slide 127

Slide 127 text

Other Talks at Velocity What Makes Mobile Websites Tick? 3:30 today Is TLS Fast Yet? 3:30 tomorrow Chasing Waterfalls 5:00 tomorrow

Slide 128

Slide 128 text

Office Hours at 3:30 today

Slide 129

Slide 129 text

Let’s Upgrade The Web

Slide 130

Slide 130 text

Thanks!

Slide 131

Slide 131 text

@jonathanklein ! [email protected] ! www.etsy.com/careers Get in Touch