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

Rendering Web Applications

Rendering Web Applications

Overview of what it means to do server rendering and client rendering. Covers the differences and considerations between the two rendering techniques.

Gastón Iván

July 25, 2015
Tweet

More Decks by Gastón Iván

Other Decks in Programming

Transcript

  1. HTML • HyperText Markup Language • 1980 - 1994 ◦

    Markup for using and sharing documents • 1995 HTML 2.0 ◦ First Standard
  2. Static and Dynamic CERN Top Secret Paper Lorem ipsum dolor

    sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Pag. 1/10 Welcome Gastón! 14 - Jul - 2015 CERN Top Secret Paper Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Pag. 1/10
  3. Dynamic web pages • 1993 CGI ◦ Common Gateway Interface

    • Execute a script that writes to stdout • 1995 PHP ◦ Hypertext Preprocesor • Can be mixed with HTML
  4. Frameworks (MVC) Server • 2000 Struts • 2001 Drupal •

    2004 Rails Client • 2007 Sproutcore • 2009 Angular • 2010 Backbone • 2011 Ember
  5. Old Assumptions • JavaScript is slow. • A server will

    always be much more powerful than a user device. • Mobile devices are slow. • Browsers have serious compatibility issues. no longer true
  6. Considerations Server • Can cache requests ◦ don’t take for

    granted • Comparable payloads with compression. • Every new page will make a round trip. Client • Small payloads • “Slow” initial render • Instant screen updates. • SEO • Two code bases
  7. Client: Code duplication The most obvious case is data validation.

    • Server side is a security layer. • Client side is just nice UX. You have to maintain both.
  8. Isomorphic Server and Client rendering with the same code. Thoughts

    • Separation of concerns • Backend/Frontend flexibility • There are other answers for code duplication.
  9. Who is the winner? The developers. Choose the right tool

    for the right job. Example: Improving performance in Twitter. com