Alessandro Nadalin | NAMSHI.comhttp://end.of.the.road?
AGENDA. History of HTTP                    . Hidden features. HTTP/2.0                    . SPDY
HTTP/X.Y ?
Web development?
WWW      Web development?
ClientsWWW      Web development?
ClientsWWW            Web development?  Servers
ClientsWWW            M2M   Web development?  Servers  Server
ClientsWWW            M2M   Web development?  Servers                   Automation
Any user can easily    interact with a         Webpage.
( except my mom )
What about machines?
They need rules.
verbs        They need rules.
verbs        They need rules.                    domains
verbs         They need rules.        workflows                     domains
verbs                    logic         They need rules.        workflows                            domains
verbs                    logic         They need rules.                             constraints        workflows          ...
PROTOCOLS
HTTP/0.9
HTTP/0.9    (1991)
HTTP/1.0
1996                   GETTim Berners-Lee                  POST                  separate connections                     ...
HTTP/1.1
PUTTim Berners-Lee    1996                   GET                                                         TRACE            ...
EXPIRES     MAX-AGE                 CACHE CHANNELS                        CACHE 304 Not modified              http://www.w...
<feed xmlns="http://www.w3.org/2005/Atom"   xmlns:cc="http://purl.org/syndication/cache-channel">    <title>Invalidations ...
GET /users/1           HTTP/1.1 200 Ok  HTTP/1.1               Etag: 123abc  Host: example.comGET /users/1 HTTP/1.1     HT...
GET /users/1 HTTP/1.1   HTTP/1.1 200 OkHost: example.com       Cache-Control: max-age=60GET /users/1 HTTP/1.1Host: example...
FOR FREE
and here are a few ways to doso, using         expiration         validation        invalidation
Expiration
GET / HTTP/1.1Host: www.example.comExpires: 0
GET / HTTP/1.1Host: www.example.comExpires: 0
GET / HTTP/1.1Host: www.example.comExpires: Tue, 15 Nov 1994 01:00 GMT
GET / HTTP/1.1Host: www.example.comCache-Control: max-age=60, public
GET / HTTP/1.1Host: www.example.comCache-Control: max-age=60, public
GET / HTTP/1.1Host: www.example.comCache-Control: max-age=60, public     Cacheable for 60 seconds
GET / HTTP/1.1Host: www.example.comCache-Control: max-age=60, publicCacheable by both local and shared caches
GET / HTTP/1.1Host: www.example.comCache-Control: stale-if-error=600, stale-while-revalidate=600
GET / HTTP/1.1Host: www.example.comCache-Control: stale-if-error=600, stale-while-revalidate=600                         f...
GET / HTTP/1.1Host: www.example.comCache-Control: stale-if-error=600, stale-while-revalidate=600                  availabl...
GET / HTTP/1.1Host: www.example.comCache-Control: stale-if-error=600, stale-while-revalidate=600                available ...
Validation
GET / HTTP/1.1Host: www.example.comEtag: 1234
GET / HTTP/1.1  Host: www.example.  com  Etag: 1234an identifier for your response
Conditional requests         GET / HTTP/1.1         Host: www.example.         com         If-None-Match: 1234the browsers...
Relax
Calculating an Etag is cheaper than generating a full MVC                         response
HTTP/1.1 304 Not Modified
GET / HTTP/1.1Host: www.example.comLast-Modified: Tue, 15 Jan 2011 12:00:00 GMT
GET / HTTP/1.1Host: www.example.comLast-Modified: Tue, 15 Jan 2011 12:00:00 GMT         tell the client about the latest c...
Conditional requestsGET / HTTP/1.1Host: www.example.comIf-Modified-Since: Tue, 15 Jan 2011 12:00:00 GMTthe client asks you...
Relax
Calculating a date is cheaper than retrieving an entire object
HTTP/1.1 304 Not Modified
Invalidation
The web is not meant for invalidating data.Server should not be able to keep clients state, otherwise                  the...
but hey, you say
HTTPs cache fails when dealing with really dynamicpages, because consumers will always have to hit the  origin server, alt...
Nope       Nope
ESI was built for that    http://www.w3.org/TR/esi-lang
HInclude was built for that         http://mnot.github.com/hinclude/
So what does HTTP cache is meant to solve?
Less work
http://www.flickr.com/photos/snakphotography/5004775320/sizes/o/in/photostream/  because the hard work is delegated to the...
evolve
because cache is abstracted from the application
loose coupling
because caching is bound to the protocol, HTTP,not to your implementation ( Sf, RoR, Django )
it all started
21
years
ago
Damn.
HTTP/2.0
Nothing to see here.
SPDY
http://dev.chromium.org/spdy/spdy-whitepaper
Youre already using it
HTTP on steroids
Requests prioritization
Client   Server
Client   Server
Client   Server
Client   Server
Compression
Extended compression
Multiplexing
Client      ServerR/R model
Client      ServerR/R model
Client      ServerR/R model
Client       ServerPipelining
Client       ServerPipelining
Client        ServerMultiplexing
Client        ServerMultiplexing
Client        ServerMultiplexing
Server push
Result?
SPDY
HTTP       SPDY
Not-so-side effect?
13 years later...
HTTP/2.0
Based on?
SPDYhttp://lists.w3.org/Archives/Public/ietf-http-wg/2012OctDec/0004.html    http://www.slideshare.net/mnot/what-http20-wi...
Which is based on?
HTTP/1.1
SPDY doesnt change the protocol,it just changes the way messages are        exchanged over the wire
Semantics are the same.
Workflows are the same.
Verbs are the same.
The interface is the same.
And HTTP/1.1 is based on?
HTTP/1.0
15
damn
years
Ago
PERIOD.
An architecture that lasts 20 years is possible.
( REST )
You?
Alex Nadalin
Alex Nadalin    odino.org
Alex Nadalin    odino.org  @_odino_
Alex Nadalin    odino.org  @_odino_
Alex Nadalin    odino.org  @_odino_
Alex Nadalin    odino.org   DXB  @_odino_
Alex Nadalin    odino.org   DXB  @_odino_
Were hiring!
In Dubai.
In Dubai.alex.nadalin@namshi.com
In Dubai.alex.nadalin@namshi.com       @_odino_
In Dubai.alex.nadalin@namshi.com       @_odino_     TALK TO ME!
HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?
HTTP colon slash slash: the end of the road?
Upcoming SlideShare
Loading in …5
×

HTTP colon slash slash: the end of the road?

3,675 views
3,518 views

Published on

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).

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,675
On SlideShare
0
From Embeds
0
Number of Embeds
772
Actions
Shares
0
Downloads
34
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

HTTP colon slash slash: the end of the road?

  1. 1. Alessandro Nadalin | NAMSHI.comhttp://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. ClientsWWW Web development?
  7. 7. ClientsWWW Web development? Servers
  8. 8. ClientsWWW M2M Web development? Servers Server
  9. 9. ClientsWWW 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 GETTim Berners-Lee POST separate connections HEAD Roy Fielding
  24. 24. HTTP/1.1
  25. 25. PUTTim 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.htmlSCALABILITY
  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.comGET /users/1 HTTP/1.1 HTTP/1.1 304 NotHost: example.com ModifiedIf-None-Match: 123abcPOST /users/1 HTTP/1.1 HTTP/1.1 412Host: example.com Precondition FailedEtag: 123abcdefgh...
  29. 29. GET /users/1 HTTP/1.1 HTTP/1.1 200 OkHost: example.com Cache-Control: max-age=60GET /users/1 HTTP/1.1Host: example.com
  30. 30. FOR FREE
  31. 31. and here are a few ways to doso, using expiration validation invalidation
  32. 32. Expiration
  33. 33. GET / HTTP/1.1Host: www.example.comExpires: 0
  34. 34. GET / HTTP/1.1Host: www.example.comExpires: 0
  35. 35. GET / HTTP/1.1Host: www.example.comExpires: Tue, 15 Nov 1994 01:00 GMT
  36. 36. GET / HTTP/1.1Host: www.example.comCache-Control: max-age=60, public
  37. 37. GET / HTTP/1.1Host: www.example.comCache-Control: max-age=60, public
  38. 38. GET / HTTP/1.1Host: www.example.comCache-Control: max-age=60, public Cacheable for 60 seconds
  39. 39. GET / HTTP/1.1Host: www.example.comCache-Control: max-age=60, publicCacheable by both local and shared caches
  40. 40. GET / HTTP/1.1Host: www.example.comCache-Control: stale-if-error=600, stale-while-revalidate=600
  41. 41. GET / HTTP/1.1Host: www.example.comCache-Control: stale-if-error=600, stale-while-revalidate=600 fault-tolerant
  42. 42. GET / HTTP/1.1Host: www.example.comCache-Control: stale-if-error=600, stale-while-revalidate=600 available during downtime
  43. 43. GET / HTTP/1.1Host: www.example.comCache-Control: stale-if-error=600, stale-while-revalidate=600 available during revalidation
  44. 44. Validation
  45. 45. GET / HTTP/1.1Host: www.example.comEtag: 1234
  46. 46. GET / HTTP/1.1 Host: www.example. com Etag: 1234an identifier for your response
  47. 47. Conditional requests GET / HTTP/1.1 Host: www.example. com If-None-Match: 1234the 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.1Host: www.example.comLast-Modified: Tue, 15 Jan 2011 12:00:00 GMT
  52. 52. GET / HTTP/1.1Host: www.example.comLast-Modified: Tue, 15 Jan 2011 12:00:00 GMT tell the client about the latest change
  53. 53. Conditional requestsGET / HTTP/1.1Host: www.example.comIf-Modified-Since: Tue, 15 Jan 2011 12:00:00 GMTthe 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.Thats why long-polling and endless connections havent had big success dealing with caching.
  59. 59. but hey, you say
  60. 60. HTTPs cache fails when dealing with really dynamicpages, 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. Youre 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 ServerR/R model
  91. 91. Client ServerR/R model
  92. 92. Client ServerR/R model
  93. 93. Client ServerPipelining
  94. 94. Client ServerPipelining
  95. 95. Client ServerMultiplexing
  96. 96. Client ServerMultiplexing
  97. 97. Client ServerMultiplexing
  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. SPDYhttp://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. Were 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!

×