Web performance across the HTTP to HTTPS transition

20
Web performance across the HTTP to HTTPS transition Sean Walbran [email protected]

description

Velocity 2010 Ignite talk - http://velocityconf.com/velocity2010/public/schedule/detail/15574

Transcript of Web performance across the HTTP to HTTPS transition

Page 1: Web performance across the HTTP to HTTPS transition

Web performance across the

HTTP to HTTPS transition

Sean Walbran

[email protected]

Page 2: Web performance across the HTTP to HTTPS transition
Page 3: Web performance across the HTTP to HTTPS transition

Meeting people

http://commons.wikimedia.org/wiki/File:MNSF_Crowds.JPG

Page 4: Web performance across the HTTP to HTTPS transition

HTTP is for everybody

Page 5: Web performance across the HTTP to HTTPS transition

HTTPS is for relationships

http://commons.wikimedia.org/wiki/File:RoyalBicycleBuiltForTwoBastilleDay2008.jpg

Page 6: Web performance across the HTTP to HTTPS transition

HTTPS is for sharing secrets

Page 7: Web performance across the HTTP to HTTPS transition

Performance at the transition is crucial

Page 8: Web performance across the HTTP to HTTPS transition

Slow by default

Page 9: Web performance across the HTTP to HTTPS transition

It’s complicated

• Network

• Encryption overhead

• CDN

• Browser cache

• Prefetching & security

• …and more

Page 10: Web performance across the HTTP to HTTPS transition

Network

• All new sockets

• Additional RTT each

Connect ahead

Keep alive

Page 11: Web performance across the HTTP to HTTPS transition

Encryption overhead

Server side: -75% cpu by offloading*

Client side: ~2x cpu vs. HTTP

Mobile / Netbook impact

=> Reduce

Offload

Prefetch

* admittedly, a years-old metric

Page 12: Web performance across the HTTP to HTTPS transition

CDN

HTTPS == LRUzer

Page 13: Web performance across the HTTP to HTTPS transition

CDN

Not all PoPs are created equal

10ms to their HTTP-only corporate domain

30ms to our HTTPS-enabled domain

Use separate domains for HTTP & HTTPS

Prefetch

Page 14: Web performance across the HTTP to HTTPS transition

Browser cache

http://www.flickr.com/photos/43426549@N00/1812312679/

Page 15: Web performance across the HTTP to HTTPS transition

Browser cache

Suddenly empty!

Trust: only HTTPS content on HTTPS pages

Browser: HTTPS url’s are different

Schemeless URL’s don’t help

<a href=“//example.com/image.png”>

Page 16: Web performance across the HTTP to HTTPS transition

Browser cache: Firefox

HTTPS content is cached

only in memory

by default

Set Cache-Control: public

https://bugzilla.mozilla.org/show_bug.cgi?id=531801

Page 17: Web performance across the HTTP to HTTPS transition

Browser cache: IE

“WinINET will not reuse a previously-cached resource delivered over HTTPS until at least one secure connection to the target host has been established by the current process.”

Connect ahead, prefetch

http://blogs.msdn.com/b/ieinternals/archive/2010/04/21/internet-explorer-may-bypass-cache-for-cross-domain-https-content.aspx

Page 18: Web performance across the HTTP to HTTPS transition

Prefetch to the rescue

Page 19: Web performance across the HTTP to HTTPS transition

HTTPS prefetch quirks

Firefox + jquery, in HTTP context $.ajax( https script url ) => 0 byte cache entry => key: anon&uri=https://… new Image().src = https script url => 0 byte cache entry => 206/partial content next fetch

Page 20: Web performance across the HTTP to HTTPS transition

Summary

• HTTPS transition matters – it’s the first date

• Slow by default

• Reasons are many

Prefetch, but verify it’s working

Tune for CDN and browser cache quirks

Minimize socket creation