Intro to SPDY

Intro to SPDY

A talk on SPDY, the foundation for Http 2.0, and how it makes the web faster.

3ca5501cb61a4251bd1e6f0a878bb8d4?s=128

Michael Hamrah

April 12, 2013
Tweet

Transcript

  1. SPDY://WHAT? PROTOCOLS, TRANSPORTS, AND SPEED Created by / Michael Hamrah

    @mhamrah
  2. None
  3. WHAT PROBLEM ARE WE TRYING TO SOLVE? Web sites are

    slow*
  4. HOW DO WE WANT TO SOLVE IT? We dont!

  5. IS HTTP THAT BAD? V E R B / s

    o m e / p a t h / t o / c o n t e n t H T T P / 1 . 1 H o s t : w w w . s o m e h o s t . c o m A c c e p t : t e x t / h t m l A c c e p t - L a n g u a g e : e n - u s A c c e p t - E n c o d i n g : g z i p , d e f l a t e U s e r - A g e n t : M o z i l l a / 5 . 0 ( M a c i n t o s h ; I n t e l M a c O S X 1 0 _ 8 _ 3 ) A p p l e W e b K i t / 5 3 7 . 3 1 ( C o n n e c t i o n : K e e p - A l i v e C o n t e n t - L e n g t h : 2 0 M a y b e s o m e b o d y h e r e
  6. A QUICK DETOUR FOR TCP WHAT GOES INTO A CONNECTION?

    Round trip: Syn/Syn-Ack/Ack (LATENCY!) NYC to SFC: ~2530mi, RTT in vacuum: 27ms, RTT in fiber: 41.04ms Slow-Start/Window Scaling (Diminishing returns on bandwidth)
  7. HOW DO WE SOLVE THIS NOW? Http 1.1: Keep-alive default

    (option for 1.0 Http 1.1: Pipelining (not good enough, maybe not even used) Browsers: 6-8 max concurrent connections per server Think of 1mb of data split 1, 10, 100 ways cache-control Minimize connections (sprites, minification, domain sharding)
  8. WASN'T THIS TALK ON SPDY? SPDY embraces HTTP, don't reinvent

    wheel. It's not WebSockets, different problem.
  9. MULTIPLEXING Spdy uses one persistent SSL connection and multiplexes requests.

    True duplex; no waiting. Better window scaling Frames replace individual request/response (Control Frames/Data Frames)
  10. COMPRESSED HEADERS More important than you may realize! Cookies, repetitive

    headers, etc.
  11. CONTENT PRIORITIZATION Have some control between browser/server

  12. SERVER PUSH/SERVER HINT Server can send or suggest new resources

    without client having to parse html
  13. SPDY: TRY IT! TLS connection uses NPN (Next Protocol Negotitation

    to upgrade to SPDY) HTTP semantics do not change Support for node.js (node-spdy), NGINX, Apache HTTP 2.0 will be largerly based on SPDY http://dev.chromium.org/spdy
  14. LINKS Spdy Whitepaper TCP Tuning Content Negotiation with HAProxy Best

    Practices Mozilla learning lab