Successfully reported this slideshow.

HTTP colon slash slash: the end of the road?

2

Share

Upcoming SlideShare
Introduction to HTTP/2
Introduction to HTTP/2
Loading in …3
×
1 of 141
1 of 141

HTTP colon slash slash: the end of the road?

2

Share

Download to read offline

Presentation given at the International PHP conference in Mainz, October 2012, dealing with a bit of history about the HTTP protocol, SPDY and the future (HTTP/2.0).

Presentation given at the International PHP conference in Mainz, October 2012, dealing with a bit of history about the HTTP protocol, SPDY and the future (HTTP/2.0).

More Related Content

More from Alessandro Nadalin

Related Books

Free with a 14 day trial from Scribd

See all

HTTP colon slash slash: the end of the road?

  1. 1. Alessandro Nadalin | NAMSHI.com http://end.of.the.road?
  2. 2. AGENDA . History of HTTP . Hidden features . HTTP/2.0 . SPDY
  3. 3. HTTP/X.Y ?
  4. 4. Web development?
  5. 5. WWW Web development?
  6. 6. Clients WWW Web development?
  7. 7. Clients WWW Web development? Servers
  8. 8. Clients WWW M2M Web development? Servers Server
  9. 9. Clients WWW M2M Web development? Servers Automation
  10. 10. Any user can easily interact with a Webpage.
  11. 11. ( except my mom )
  12. 12. What about machines?
  13. 13. They need rules.
  14. 14. verbs They need rules.
  15. 15. verbs They need rules. domains
  16. 16. verbs They need rules. workflows domains
  17. 17. verbs logic They need rules. workflows domains
  18. 18. verbs logic They need rules. constraints workflows domains
  19. 19. PROTOCOLS
  20. 20. HTTP/0.9
  21. 21. HTTP/0.9 (1991)
  22. 22. HTTP/1.0
  23. 23. 1996 GET Tim Berners-Lee POST separate connections HEAD Roy Fielding
  24. 24. HTTP/1.1
  25. 25. PUT Tim Berners-Lee 1996 GET TRACE Domain Application Protocol PATCH POST Roy Fielding separate connections DELET OPTIONS HEAD E DIFF
  26. 26. EXPIRES MAX-AGE CACHE CHANNELS CACHE 304 Not modified http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html SCALABILITY
  27. 27. <feed xmlns="http://www.w3.org/2005/Atom" xmlns:cc="http://purl.org/syndication/cache-channel"> <title>Invalidations for www.example.org</title> <id>http://admin.example.org/events/</id> <link rel="self" href="http://admin.example.org/events/current"/> <link rel="prev-archive" href="http://admin.example.org/events/archive/1234"/> <updated>2007-04-13T11:23:42Z</updated> <author> <name>Administrator</name> <email>web-admin@example.org</email> </author> <cc:precision>60</cc:precision> <cc:lifetime>2592000</cc:lifetime> <entry> <title>stale</title> <id>http://admin.example.org/events/1124</id> <updated>2007-04-13T11:23:42Z</updated> <link href="urn:uuid:50D3565C-97A8-40E1-A5C8-CFA070166FEF"/> <cc:stale/> </entry> <entry> <title>stale</title> <id>http://admin.example.org/events/1125</id> <updated>2007-04-13T10:31:01Z</updated> <link href="http://www.example.org/img/123.gif" type="image/gif"/> <link href="http://www.example.org/img/123.png" type="image/png"/> <cc:stale/> </entry>
  28. 28. GET /users/1 HTTP/1.1 200 Ok HTTP/1.1 Etag: 123abc Host: example.com GET /users/1 HTTP/1.1 HTTP/1.1 304 Not Host: example.com Modified If-None-Match: 123abc POST /users/1 HTTP/1.1 HTTP/1.1 412 Host: example.com Precondition Failed Etag: 123abcdefgh ...
  29. 29. GET /users/1 HTTP/1.1 HTTP/1.1 200 Ok Host: example.com Cache-Control: max-age=60 GET /users/1 HTTP/1.1 Host: example.com
  30. 30. FOR FREE
  31. 31. and here are a few ways to do so, using expiration validation invalidation
  32. 32. Expiration
  33. 33. GET / HTTP/1.1 Host: www.example.com Expires: 0
  34. 34. GET / HTTP/1.1 Host: www.example.com Expires: 0
  35. 35. GET / HTTP/1.1 Host: www.example.com Expires: Tue, 15 Nov 1994 01:00 GMT
  36. 36. GET / HTTP/1.1 Host: www.example.com Cache-Control: max-age=60, public
  37. 37. GET / HTTP/1.1 Host: www.example.com Cache-Control: max-age=60, public
  38. 38. GET / HTTP/1.1 Host: www.example.com Cache-Control: max-age=60, public Cacheable for 60 seconds
  39. 39. GET / HTTP/1.1 Host: www.example.com Cache-Control: max-age=60, public Cacheable by both local and shared caches
  40. 40. GET / HTTP/1.1 Host: www.example.com Cache-Control: stale-if-error=600, stale-while-revalidate=600
  41. 41. GET / HTTP/1.1 Host: www.example.com Cache-Control: stale-if-error=600, stale-while-revalidate=600 fault-tolerant
  42. 42. GET / HTTP/1.1 Host: www.example.com Cache-Control: stale-if-error=600, stale-while-revalidate=600 available during downtime
  43. 43. GET / HTTP/1.1 Host: www.example.com Cache-Control: stale-if-error=600, stale-while-revalidate=600 available during revalidation
  44. 44. Validation
  45. 45. GET / HTTP/1.1 Host: www.example. com Etag: 1234
  46. 46. GET / HTTP/1.1 Host: www.example. com Etag: 1234 an identifier for your response
  47. 47. Conditional requests GET / HTTP/1.1 Host: www.example. com If-None-Match: 1234 the browsers asks you if it has been modified
  48. 48. Relax
  49. 49. Calculating an Etag is cheaper than generating a full MVC response
  50. 50. HTTP/1.1 304 Not Modified
  51. 51. GET / HTTP/1.1 Host: www.example.com Last-Modified: Tue, 15 Jan 2011 12:00:00 GMT
  52. 52. 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
  53. 53. Conditional requests 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
  54. 54. Relax
  55. 55. Calculating a date is cheaper than retrieving an entire object
  56. 56. HTTP/1.1 304 Not Modified
  57. 57. Invalidation
  58. 58. The web is not meant for invalidating data. Server should not be able to keep clients' state, otherwise they wont scale well. That's why long-polling and endless connections haven't had big success dealing with caching.
  59. 59. but hey, you say
  60. 60. 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 )
  61. 61. Nope Nope
  62. 62. ESI was built for that http://www.w3.org/TR/esi-lang
  63. 63. HInclude was built for that http://mnot.github.com/hinclude/
  64. 64. So what does HTTP cache is meant to solve?
  65. 65. Less work
  66. 66. http://www.flickr.com/photos/snakphotography/5004775320/sizes/o/in/photostream/ because the hard work is delegated to the browser/proxy
  67. 67. evolve
  68. 68. because cache is abstracted from the application
  69. 69. loose coupling
  70. 70. because caching is bound to the protocol, HTTP, not to your implementation ( Sf, RoR, Django )
  71. 71. it all started
  72. 72. 21
  73. 73. years
  74. 74. ago
  75. 75. Damn.
  76. 76. HTTP/2.0
  77. 77. Nothing to see here.
  78. 78. SPDY
  79. 79. http://dev.chromium.org/spdy/spdy-whitepaper
  80. 80. You're already using it
  81. 81. HTTP on steroids
  82. 82. Requests prioritization
  83. 83. Client Server
  84. 84. Client Server
  85. 85. Client Server
  86. 86. Client Server
  87. 87. Compression
  88. 88. Extended compression
  89. 89. Multiplexing
  90. 90. Client Server R/R model
  91. 91. Client Server R/R model
  92. 92. Client Server R/R model
  93. 93. Client Server Pipelining
  94. 94. Client Server Pipelining
  95. 95. Client Server Multiplexing
  96. 96. Client Server Multiplexing
  97. 97. Client Server Multiplexing
  98. 98. Server push
  99. 99. Result?
  100. 100. SPDY
  101. 101. HTTP SPDY
  102. 102. Not-so-side effect?
  103. 103. 13 years later...
  104. 104. HTTP/2.0
  105. 105. Based on?
  106. 106. SPDY http://lists.w3.org/Archives/Public/ietf-http-wg/2012OctDec/0004.html http://www.slideshare.net/mnot/what-http20-will-do-for-you
  107. 107. Which is based on?
  108. 108. HTTP/1.1
  109. 109. SPDY doesnt change the protocol, it just changes the way messages are exchanged over the wire
  110. 110. Semantics are the same.
  111. 111. Workflows are the same.
  112. 112. Verbs are the same.
  113. 113. The interface is the same.
  114. 114. And HTTP/1.1 is based on?
  115. 115. HTTP/1.0
  116. 116. 15
  117. 117. damn
  118. 118. years
  119. 119. Ago
  120. 120. PERIOD.
  121. 121. An architecture that lasts 20 years is possible.
  122. 122. ( REST )
  123. 123. You?
  124. 124. Alex Nadalin
  125. 125. Alex Nadalin odino.org
  126. 126. Alex Nadalin odino.org @_odino_
  127. 127. Alex Nadalin odino.org @_odino_
  128. 128. Alex Nadalin odino.org @_odino_
  129. 129. Alex Nadalin odino.org DXB @_odino_
  130. 130. Alex Nadalin odino.org DXB @_odino_
  131. 131. We're hiring!
  132. 132. In Dubai.
  133. 133. In Dubai. alex.nadalin@namshi.com
  134. 134. In Dubai. alex.nadalin@namshi.com @_odino_
  135. 135. In Dubai. alex.nadalin@namshi.com @_odino_ TALK TO ME!

×