HTTP colon slash slash: end of the road? @ CakeFest 2013 in San Francisco

Embed Size (px)

DESCRIPTION

The HTTP protocol has been there for more than 20 years, almost untouched, but the current needs of the web are pushing towards adding some spices into the mix. In this talk we will have a brief look at the history of HTTP, what SPDY - the "new" protocol proposed by google - brings into the table and how HTTP/2.0 will look like.

Citation preview

2. WARNING 3. NO CAKEPHP AHEAD 4. 2ND WARNING 5. OLD http://www.flickr.com/photos/leoheart/391958347/sizes/o/in/photostream/ 6. AGENDA . History of HTTP . Hidden features . HTTP/2.0 . SPDY 7. HTTP/X.Y ? 8. HTTP/1.1? 9. Web development? 10. Web development? www Clients M2MServers Automation 11. Any user can easily interact with a Webpage. 12. ( except my mom ) 13. What about machines? 14. They need rules. 15. www Clients M2MServers Automation logic Web development? 16. Web development? www Clients M2MServers Automation verbs domains workflows logic 17. Web development? www Clients M2MServers Automation verbs domains workflows logic constraints 18. PROTOCOLS 19. 1991 20. HTTP/0.9 21. HTTP/1.0 22. Web development? www Clients M2MServers Automation verbs domains workflows logic constraints 23. Web development? www Clients M2MServers Automation verbs domains workflows logic constraints Tim Berners-Lee Roy Fielding 1996 24. Web development? www Clients M2MServers Automation verbs domains workflows logic constraints Tim Berners-Lee Roy Fielding GET separate connections POST HEAD1996 25. HTTP/1.1 26. Web development? www Clients M2MServers Automation verbs domains workflows logic constraints Tim Berners-Lee Roy Fielding GET separate connections POST HEAD1996 27. Web development? www Clients M2MServers Automation verbs domains workflows logic constraints Tim Berners-Lee Roy Fielding GET separate connections POST HEAD1996 DIFF PUT DELETE PATCH TRACE OPTIONS 28. Web development? www Clients M2MServers Automation verbs domains workflows logic constraints Tim Berners-Lee Roy Fielding GET separate connections POST HEAD1996 DIFF PUT DELETE PATCH TRACE OPTIONS 29. Web development? www Clients M2MServers Automation verbs domains workflows logic constraints Tim Berners-Lee Roy Fielding GET separate connections POST HEAD1996 DIFF PUT DELETE PATCH TRACE OPTIONS Cache 30. CACHE 31. GET /users/1 HTTP/1.1 Host: example.com HTTP/1.1 200 Ok Etag: 123abc GET /users/1 HTTP/1.1 Host: example.com If-None-Match: 123abc HTTP/1.1 304 Not Modified POST /users/1 HTTP/1.1 Host: example.com Etag: 123abcdefgh ... HTTP/1.1 412 Precondition Failed 32. GET /users/1 HTTP/1.1 Host: example.com HTTP/1.1 200 Ok Cache-Control: max-age=60 GET /users/1 HTTP/1.1 Host: example.com 33. FOR FREE 34. and here are a few ways to do so, using expiration validation invalidation 35. Expiration 36. GET / HTTP/1.1 Host: www.example.com Expires: 0 37. GET / HTTP/1.1 Host: www.example.com Expires: 0 38. GET / HTTP/1.1 Host: www.example.com Expires: Tue, 15 Nov 1994 01:00 GMT 39. GET / HTTP/1.1 Host: www.example.com Cache-Control: max-age=60, public 40. GET / HTTP/1.1 Host: www.example.com Cache-Control: max-age=60, public 41. GET / HTTP/1.1 Host: www.example.com Cache-Control: max-age=60, public Cacheable for 60 seconds 42. GET / HTTP/1.1 Host: www.example.com Cache-Control: max-age=60, public Cacheable by both local and shared caches 43. GET / HTTP/1.1 Host: www.example.com Cache-Control: stale-if-error=600, stale-while-revalidate=600 44. GET / HTTP/1.1 Host: www.example.com Cache-Control: stale-if-error=600, stale-while-revalidate=600 fault-tolerant 45. GET / HTTP/1.1 Host: www.example.com Cache-Control: stale-if-error=600, stale-while-revalidate=600 available during downtime 46. GET / HTTP/1.1 Host: www.example.com Cache-Control: stale-if-error=600, stale-while-revalidate=600 available during revalidation 47. Validation 48. GET / HTTP/1.1 Host: www.example. com Etag: 1234 49. GET / HTTP/1.1 Host: www.example. com Etag: 1234 an identifier for your response 50. GET / HTTP/1.1 Host: www.example. com If-None-Match: 1234 the browsers asks you if it has been modified Conditional requests 51. Relax 52. Calculating an Etag is cheaper than generating a full MVC response 53. HTTP/1.1 304 Not Modified 54. GET / HTTP/1.1 Host: www.example.com Last-Modified: Tue, 15 Jan 2011 12:00:00 GMT 55. GET / HTTP/1.1 Host: www.example.com Last-Modified: Tue, 15 Jan 2011 12:00:00 GMT tell the client about the latest change 56. GET / HTTP/1.1 Host: www.example.com If-Modified-Since: Tue, 15 Jan 2011 12:00:00 GMT the client asks you if it has been modified since the last time Conditional requests 57. Relax 58. Calculating a date is cheaper than retrieving an entire object 59. HTTP/1.1 304 Not Modified 60. but hey, you say 61. HTTP's cache fails when dealing with really dynamic pages, because consumers will always have to hit the origin server, although a part of the page would be cacheable ( header and footer, for example ) 62. Nope 63. ESI was built for that http://www.w3.org/TR/esi-lang 64. HInclude was built for that http://mnot.github.com/hinclude/ 65. So what does HTTP cache is meant to solve? 66. Less work 67. because the hard work is delegated to the browser/proxy http://www.flickr.com/photos/snakphotography/5004775320/sizes/o/in/photostream/ 68. evolve 69. because cache is abstracted from the application 70. loose coupling 71. because caching is bound to the protocol, HTTP, not to your implementation ( Sf, RoR, Django ) 72. Weve just ignored it so far 73. for 22 years 74. HTTP/2.0 75. Nothing to see here. 76. SPDY 77. http://dev.chromium.org/spdy/spdy-whitepaper 78. You're already using it 79. HTTP on steroids 80. Requests prioritization 81. Client Server 82. Client Server 83. Client Server 84. Client Server 85. Compression 86. Extended compression 87. Multiplexing 88. Client Server R/R model 89. Client Server R/R model 90. Client Server R/R model 91. Client Server Pipelining 92. Client Server Pipelining 93. Client Server Multiplexing 94. Client Server Multiplexing 95. Client Server Multiplexing 96. Server push 97. Result? 98. Not-so-side effect? 99. 14 years later... 100. HTTP/2.0 101. https://github.com/http2/http2-spec http://tools.ietf.org/html/draft-ietf-httpbis-http2-04 102. GET /index.html HTTP/1.1 Host: www.example.com SURPRISE! 103. it will be a binary protocol http://tech.slashdot.org/story/13/07/09/1455200/http-20-will-be-a-binary-protocol 104. 00 39 01 05 00 00 00 01 84 83 42 11 77 77 77 2e 67 6f 6f 67 6c 65 2e 63 6f 6d 3a 38 30 4c 0d 6d 79 2d 75 73 65 72 2d 61 67 65 6e 74 40 0d 78 2d 73 6f 6d 65 2d 68 65 61 64 65 72 05 66 69 72 73 74 105. Improved performances http://www.itnews.com.au/News/349694,next-version-of-hyper-text-protocol-to-be-binary.aspx 106. GET /default.htm HTTP/1.1 Host: server.example.com Connection: Upgrade, HTTP2-Settings Upgrade: HTTP/2.0 HTTP2-Settings: 107. GET /default.htm HTTP/1.1 Host: server.example.com Connection: Upgrade, HTTP2-Settings Upgrade: HTTP/2.0 HTTP2-Settings: 108. Based on? 109. SPDY http://lists.w3.org/Archives/Public/ietf-http-wg/2012OctDec/0004.html http://www.slideshare.net/mnot/what-http20-will-do-for-you 110. Which is based on? 111. HTTP/1.1 112. SPDY doesnt change the protocol, it just changes the way messages are exchanged over the wire 113. Semantics are the same. 114. Workflows are the same. 115. Verbs are the same. 116. The interface is the same. 117. The minimum bar to entry for replacing HTTP/1.1 is to exactly support its semantics and capabilities, while making it more efficient Mark Nottingham http://www.mnot.net/blog/2009/11/13/flip 118. And HTTP/1.1 is based on? 119. HTTP/1.0 120. Published 17 years ago 121. An architecture that lasts 20 years is possible. 122. ( REST ) 123. ...yawn... 124. Alessandro Nadalin 125. Alessandro Nadalin @_odino_ 126. Alessandro Nadalin @_odino_ Namshi | Rocket Internet 127. Alessandro Nadalin @_odino_ Namshi | Rocket Internet VP Technology 128. Alessandro Nadalin @_odino_ Namshi | Rocket Internet VP Technology odino.org 129. Thanks! Alessandro Nadalin @_odino_ Namshi | Rocket Internet VP Technology odino.org