Upgrade to Pro — share decks privately, control downloads, hide ads and more …

You Ain't SPDY (Ruby Nation)

chris
March 24, 2012

You Ain't SPDY (Ruby Nation)

You package your assets. You use CSS sprites. You serve up everything with gzip compression. You obsess over Yslow recommendations. But you are still not SPDY.

chris

March 24, 2012
Tweet

More Decks by chris

Other Decks in Programming

Transcript

  1. Why SPDY? Deliver web pages and sophisticated web applications faster

    and more securely than is possible with vanilla HTTP
  2. HTTP is antiquated HTTP has not been updated in 12

    years HTTP is old HTTP is so old...
  3. 38% of broadband users will close a site if it

    doesn't respond in 4 seconds
  4. 38% of broadband users will close a site if it

    doesn't respond in 4 seconds (precision is the key to any good statistic)
  5. took 4.2 seconds to load 469kB of data over 75

    requests took ??? seconds to load 806kB of data over 83 requests
  6. took 4.2 seconds to load 469kB of data over 75

    requests took ??? seconds to load 806kB of data over 83 requests Average: 816kB of data over 83 requests
  7. Why Not Start the Tubes Warm? • Large congestion window

    (CWND) • CWND is initially 3 • 6 connections => we already have 18 initial CWND
  8. Why Not Start the Tubes Warm? • Large congestion window

    (CWND) • CWND is initially 3 • 6 connections => we already have 18 initial CWND • Already subverting TCP/IP • Is subverting further a good idea? • Especially given data loss rates that we already see?
  9. SPDY • Built on SSL • Binary • Don't send

    redundant header information • Aggressively compress stuff • Use a single(!) tube ◦ Only pay the warm-up penalty once ◦ Just like downloading an Ubuntu ISO!!!
  10. SPDY • SYN_STREAM • SYN_REPLY • RST_STREAM • SETTINGS •

    HEADERS • PING • GOAWAY • WINDOW_UPDATE • DATA
  11. SPDY • SYN_STREAM • SYN_REPLY • RST_STREAM • SETTINGS •

    HEADERS • PING • GOAWAY • WINDOW_UPDATE • DATA
  12. • An openssl-generated server key • The SPDY Gem •

    Edge-openssl for NPN (Next Protocol Negotiation) • Carson McDonald's NPN enabled fork of eventmachine* (in the tls-npn branch) — pull request #196 * https://github.com/carsonmcdonald/eventmachine
  13. Client Request (SYN_STREAM) +----------------------------------+ 80 02 00 01 |1| Version

    | 1 | +----------------------------------+ 02 00 00 38 | Flags (8) | Length (24 bits) | +----------------------------------+ 00 00 00 01 |X| Stream-ID (31bits) | +----------------------------------+ 00 00 00 00 |X|Associated-To-Stream-ID (31bits)| +----------------------------------+ 00 00 62 60 | Pri | Unused | | +------------------ | 64 60 06 05 | Name/value header block | 81 42 46 49 | ... | 49 41 b1 95 ....
  14. Server Response (SYN_REPLY) +----------------------------------+ 80 02 00 02 |1| Version

    | 2 | +----------------------------------+ 00 00 00 a4 | Flags (8) | Length (24 bits) | +----------------------------------+ 00 00 00 01 |X| Stream-ID (31bits) | +----------------------------------+ 00 00 78 bb | Unused | | df a2 51 b2 +---------------- | 62 e0 64 e0 | Name/value header block | 42 c4 10 03 | ... | 57 76 6a 6a
  15. Server Push (SYN_STREAM) +----------------------------------+ 80 02 00 01 |1| Version

    | 1 | +----------------------------------+ 02 00 00 51 | Flags (8) | Length (24 bits) | +----------------------------------+ 00 00 00 02 |X| Stream-ID (31bits) | +----------------------------------+ 00 00 00 01 |X|Associated-To-Stream-ID (31bits)| +----------------------------------+ 00 00 62 60 | Pri | Unused | | +------------------ | | Name/value header block | 23 c2 37 cc | ... | a0 40 52 c8 28 29 29 28
  16. Server Push #2 (SYN_STREAM) +----------------------------------+ 80 02 00 01 |1|

    Version | 1 | +----------------------------------+ 02 00 01 5b | Flags (8) | Length (24 bits) | +----------------------------------+ 00 00 00 04 |X| Stream-ID (31bits) | +----------------------------------+ 00 00 00 01 |X|Associated-To-Stream-ID (31bits)| +----------------------------------+ 00 00 62 60 | Pri | Unused | | +------------------ | | Name/value header block | 23 c2 37 cc | ... | a0 40 52 c8 28 29 29 28
  17. Thanks! Chris Strom (@eee_c) spdybook.com Coupon: rn2012 (free!) See also

    Recipes with Backbone(.js) recipeswithbackbone.com Dart for Hipsters dart4hipsters.com