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

Writing Real Time Web Apps (Updated)

Writing Real Time Web Apps (Updated)

Given at SF JavaScript meetup group May 13, 2014

Wesley Hales

May 13, 2014
Tweet

More Decks by Wesley Hales

Other Decks in Technology

Transcript

  1. Enter SPDY • SPDY addresses RTTs and PLTs • Almost

    everything we’re doing on the front end to improve perf is handled by SPDY (Push) • No need for spiriting! • A pushed resource goes into your browsers cache - nothing more, nothing less.! • GZIP (Headers but not content/images)! • Prioritization @wesleyhales
  2. SPDY The starting point of HTTP 2.0 - Nov 2014

    Proposed Standard ! http://zoompf.com/blog/2013/04/maximizing-spdy-and-ssl-performance Encapsulates HTTP Requests Transmits Content over SSL Channel 
 (for better security and compatibility with existing network infrastructure) ! @wesleyhales
  3. No SPDY - 6 Connections 13 Requests - 1.2 MB

    Load Time: 131 ms SPDY - 1 Connection 13 Requests - 1.2 MB Load Time: 57 ms https://www.onslyde.com/index-test.html @wesleyhales
  4. SPDY • Google property latency improvements from Nov 20th 2013

    • Time to first byte request to window onload event http://blog.chromium.org/2013/11/making-web-faster-with-spdy-and-http2.html @wesleyhales
  5. HTTP 2.0 “HTTP/2 isn’t magic Web performance pixie dust; you

    can’t drop it in and expect your page load times to decrease by 50%.” - Mark Nottingham (chair) @wesleyhales
  6. WebSockets • Don’t confuse with SPDY push. And It’s not

    a spec with intentions of increasing PLT (Page Load Time) • WebSockets can be layered over a SPDY connection @wesleyhales
  7. SPDY+WebSocket • Jetty 9 • Node • Ruby • Proxy

    (nginx , HAProxy) • Apache (mod_spdy) @wesleyhales
  8. Writing Real Time Apps • RPC (Remote Procedure Call) and

    PubSub (Publish & Subscribe) messaging patterns on top of raw WebSocket • WebSocket requires a sub-protocol • WAMP, JSON-RPC, custom @wesleyhales
  9. WAMP - RPC When the execution of the remote procedure

    finishes, the server responds by sending a message of type CALLRESULT or CALLERROR. @wesleyhales