Reverse ajax

32,301 views

Published on

Published in: Technology
6 Comments
15 Likes
Statistics
Notes
No Downloads
Views
Total views
32,301
On SlideShare
0
From Embeds
0
Number of Embeds
28,485
Actions
Shares
0
Downloads
122
Comments
6
Likes
15
Embeds 0
No embeds

No notes for slide

Reverse ajax

  1. 1. Reverse Ajax Something You Don’t Know About HTTP RDSS Team 2012-04Monday, May 14, 12
  2. 2. Author 澄净 F2E & Translator http://goddyzhao.meMonday, May 14, 12
  3. 3. About RDSS Research on Domain Specific Solution We focus on existing specification, solution, production etc. We apply our research to practice.Monday, May 14, 12
  4. 4. Solutions • HTTP Polling & JSONP Polling • Piggyback • Comet • Bayeux(CometD) • WebSocketsMonday, May 14, 12
  5. 5. HTTP Polling Browser Server Timeline TimelineMonday, May 14, 12
  6. 6. HTTP Polling Browser Server Ajax Requst #1 Timeline TimelineMonday, May 14, 12
  7. 7. HTTP Polling Browser Server Ajax Requst #1 Response #1(no data) Timeline TimelineMonday, May 14, 12
  8. 8. HTTP Polling Browser Server Ajax Requst #1 Response #1(no data) Timeline Timeline Ajax Requst #2Monday, May 14, 12
  9. 9. HTTP Polling Browser Server Ajax Requst #1 Response #1(no data) Timeline Timeline Ajax Requst #2 Response #2(no data)Monday, May 14, 12
  10. 10. HTTP Polling Browser Server Ajax Requst #1 Response #1(no data) Timeline Timeline Ajax Requst #2 Response #2(no data) Data/EventMonday, May 14, 12
  11. 11. HTTP Polling Browser Server Ajax Requst #1 Response #1(no data) Timeline Timeline Ajax Requst #2 Response #2(no data) Data/Event Data/EventMonday, May 14, 12
  12. 12. HTTP Polling Browser Server Ajax Requst #1 Response #1(no data) Timeline Timeline Ajax Requst #2 Response #2(no data) Data/Event Data/Event Ajax Requst #3Monday, May 14, 12
  13. 13. HTTP Polling Browser Server Ajax Requst #1 Response #1(no data) Timeline Timeline Ajax Requst #2 Response #2(no data) Data/Event Data/Event Ajax Requst #3 Response #3(with data)Monday, May 14, 12
  14. 14. HTTP PollingMonday, May 14, 12
  15. 15. HTTP PollingMonday, May 14, 12
  16. 16. HTTP Polling ProsMonday, May 14, 12
  17. 17. HTTP Polling Pros Require no special features on serverMonday, May 14, 12
  18. 18. HTTP Polling Pros Require no special features on server Works in all browsersMonday, May 14, 12
  19. 19. HTTP Polling Pros Require no special features on server Works in all browsers Easy to implement in clientMonday, May 14, 12
  20. 20. HTTP Polling Pros Require no special features on server Works in all browsers Easy to implement in client ConsMonday, May 14, 12
  21. 21. HTTP Polling Pros Require no special features on server Works in all browsers Easy to implement in client Cons Bandwidth consumingMonday, May 14, 12
  22. 22. HTTP Polling Pros Require no special features on server Works in all browsers Easy to implement in client Cons Bandwidth consuming Large amounts of useless requestsMonday, May 14, 12
  23. 23. Piggyback Browser Server Timeline TimelineMonday, May 14, 12
  24. 24. Piggyback Browser Server Ajax Requst #1 Timeline TimelineMonday, May 14, 12
  25. 25. Piggyback Browser Server Ajax Requst #1 Response #1 Timeline TimelineMonday, May 14, 12
  26. 26. Piggyback Browser Server Ajax Requst #1 Response #1 Timeline Timeline Ajax Requst #2Monday, May 14, 12
  27. 27. Piggyback Browser Server Ajax Requst #1 Response #1 Timeline Timeline Ajax Requst #2 Response #2Monday, May 14, 12
  28. 28. Piggyback Browser Server Ajax Requst #1 Response #1 Timeline Timeline Ajax Requst #2 Response #2 Data/EventMonday, May 14, 12
  29. 29. Piggyback Browser Server Ajax Requst #1 Response #1 Timeline Timeline Ajax Requst #2 Response #2 Data/Event Data/EventMonday, May 14, 12
  30. 30. Piggyback Browser Server Ajax Requst #1 Response #1 Timeline Timeline Ajax Requst #2 Response #2 Data/Event Data/Event Ajax Requst #3Monday, May 14, 12
  31. 31. Piggyback Browser Server Ajax Requst #1 Response #1 Timeline Timeline Ajax Requst #2 Response #2 Data/Event Data/Event Ajax Requst #3 Mixed Response #3(with data)Monday, May 14, 12
  32. 32. PiggybackMonday, May 14, 12
  33. 33. PiggybackMonday, May 14, 12
  34. 34. Piggyback ProsMonday, May 14, 12
  35. 35. Piggyback Pros Less resources consumptionMonday, May 14, 12
  36. 36. Piggyback Pros Less resources consumption Works in all browsersMonday, May 14, 12
  37. 37. Piggyback Pros Less resources consumption Works in all browsers No special requirements on server sideMonday, May 14, 12
  38. 38. Piggyback Pros Less resources consumption Works in all browsers No special requirements on server side ConsMonday, May 14, 12
  39. 39. Piggyback Pros Less resources consumption Works in all browsers No special requirements on server side Cons Server still have to wait for the request even though the data/event has been arrivedMonday, May 14, 12
  40. 40. Comet:http streaming Browser Server Timeline TimelineMonday, May 14, 12
  41. 41. Comet:http streaming Browser Server Long-lived Request #1 Timeline TimelineMonday, May 14, 12
  42. 42. Comet:http streaming Browser Server Long-lived Request #1 Request is suspended Timeline TimelineMonday, May 14, 12
  43. 43. Comet:http streaming Browser Server Long-lived Request #1 Request is suspended Data/Event Timeline TimelineMonday, May 14, 12
  44. 44. Comet:http streaming Browser Server Long-lived Request #1 Request is suspended Data/Event Timeline Timeline ResponseMonday, May 14, 12
  45. 45. Comet:http streaming Browser Server Long-lived Request #1 Request is suspended Data/Event Timeline Timeline Response Data/EventMonday, May 14, 12
  46. 46. Comet:http streaming Browser Server Long-lived Request #1 Request is suspended Data/Event Timeline Timeline Response Data/Event Data/EventMonday, May 14, 12
  47. 47. Comet:http streaming Browser Server Long-lived Request #1 Request is suspended Data/Event Timeline Timeline Response Data/Event Data/Event ResponseMonday, May 14, 12
  48. 48. Comet:http streaming Browser Server Long-lived Request #1 Request is suspended Data/Event Timeline Timeline Response Data/Event Data/Event Response Data/EventMonday, May 14, 12
  49. 49. Comet:http streaming Browser Server Long-lived Request #1 Request is suspended Data/Event Timeline Timeline Response Data/Event Data/Event Response Data/Event Data/EventMonday, May 14, 12
  50. 50. Comet:http streaming Browser Server Long-lived Request #1 Request is suspended Data/Event Timeline Timeline Response Data/Event Data/Event Response Data/Event Data/Event ResponseMonday, May 14, 12
  51. 51. Comet:http streamingMonday, May 14, 12
  52. 52. Comet:http streaming Forever IframeMonday, May 14, 12
  53. 53. Comet:http streaming Forever IframeMonday, May 14, 12
  54. 54. Comet:http streaming Forever Iframe Multipart xhr (multipart/x-mixed-replace)Monday, May 14, 12
  55. 55. Comet:http streaming Forever Iframe Multipart xhr (multipart/x-mixed-replace)Monday, May 14, 12
  56. 56. Comet:http streamingMonday, May 14, 12
  57. 57. Comet:http streaming ProsMonday, May 14, 12
  58. 58. Comet:http streaming Pros Save the most bandwidth usageMonday, May 14, 12
  59. 59. Comet:http streaming Pros Save the most bandwidth usage Easy to implement(FI)Monday, May 14, 12
  60. 60. Comet:http streaming Pros Save the most bandwidth usage Easy to implement(FI) ConsMonday, May 14, 12
  61. 61. Comet:http streaming Pros Save the most bandwidth usage Easy to implement(FI) Cons No way to implement error handling(FI)Monday, May 14, 12
  62. 62. Comet:http streaming Pros Save the most bandwidth usage Easy to implement(FI) Cons No way to implement error handling(FI) Not supported by all the browsers(MX)Monday, May 14, 12
  63. 63. Comet:http streaming Pros Save the most bandwidth usage Easy to implement(FI) Supported all the browsers(FI) Cons No way to implement error handling(FI) Not supported by all the browsers(MX)Monday, May 14, 12
  64. 64. Comet:Http Long Polling Browser Server Timeline TimelineMonday, May 14, 12
  65. 65. Comet:Http Long Polling Browser Server Long-lived Request #1 Timeline TimelineMonday, May 14, 12
  66. 66. Comet:Http Long Polling Browser Server Long-lived Request #1 Request is suspended Timeline TimelineMonday, May 14, 12
  67. 67. Comet:Http Long Polling Browser Server Long-lived Request #1 Request is suspended Data/Event Timeline TimelineMonday, May 14, 12
  68. 68. Comet:Http Long Polling Browser Server Long-lived Request #1 Request is suspended Data/Event Timeline Timeline Response(#1 Completed)Monday, May 14, 12
  69. 69. Comet:Http Long Polling Browser Server Long-lived Request #1 Request is suspended Data/Event Timeline Timeline Response(#1 Completed) Long-lived Request #2Monday, May 14, 12
  70. 70. Comet:Http Long Polling Browser Server Long-lived Request #1 Request is suspended Data/Event Timeline Timeline Response(#1 Completed) Long-lived Request #2Monday, May 14, 12
  71. 71. Comet:Http Long Polling Browser Server Long-lived Request #1 Request is suspended Data/Event Timeline Timeline Response(#1 Completed) Long-lived Request #2 Data/EventMonday, May 14, 12
  72. 72. Comet:Http Long Polling Browser Server Long-lived Request #1 Request is suspended Data/Event Timeline Timeline Response(#1 Completed) Long-lived Request #2 Data/Event Data/EventMonday, May 14, 12
  73. 73. Comet:Http Long Polling Browser Server Long-lived Request #1 Request is suspended Data/Event Timeline Timeline Response(#1 Completed) Long-lived Request #2 Data/Event Data/Event Response(#2 Completed)Monday, May 14, 12
  74. 74. Comet:Http Long PollingMonday, May 14, 12
  75. 75. Comet:Http Long Polling Script TagsMonday, May 14, 12
  76. 76. Comet:Http Long Polling Script Tags ProsMonday, May 14, 12
  77. 77. Comet:Http Long Polling Script Tags Pros No Cross-Domain Messaging IssueMonday, May 14, 12
  78. 78. Comet:Http Long Polling Script Tags Pros No Cross-Domain Messaging Issue Easy to implementMonday, May 14, 12
  79. 79. Comet:Http Long Polling Script Tags Pros No Cross-Domain Messaging Issue Easy to implement ConsMonday, May 14, 12
  80. 80. Comet:Http Long Polling Script Tags Pros No Cross-Domain Messaging Issue Easy to implement Cons No way to implement error handling(FI)Monday, May 14, 12
  81. 81. Comet:Http Long Polling Script Tags Pros No Cross-Domain Messaging Issue Easy to implement Supported by all the browsers Cons No way to implement error handling(FI)Monday, May 14, 12
  82. 82. Comet:Http Long PollingMonday, May 14, 12
  83. 83. Comet:Http Long Polling XMLHttpRequestMonday, May 14, 12
  84. 84. Comet:Http Long Polling XMLHttpRequestMonday, May 14, 12
  85. 85. Comet:Http Long PollingMonday, May 14, 12
  86. 86. Comet:Http Long Polling XMLHttpRequestMonday, May 14, 12
  87. 87. Comet:Http Long Polling XMLHttpRequest ProsMonday, May 14, 12
  88. 88. Comet:Http Long Polling XMLHttpRequest Pros Can implement good error handlingMonday, May 14, 12
  89. 89. Comet:Http Long Polling XMLHttpRequest Pros Can implement good error handling Easy to implementMonday, May 14, 12
  90. 90. Comet:Http Long Polling XMLHttpRequest Pros Can implement good error handling Easy to implement Supported by all the browsersMonday, May 14, 12
  91. 91. Comet:Http Long Polling XMLHttpRequest Pros Can implement good error handling Easy to implement Supported by all the browsers ConsMonday, May 14, 12
  92. 92. Comet:Http Long Polling XMLHttpRequest Pros Can implement good error handling Easy to implement Supported by all the browsers Cons No main disadvantagesMonday, May 14, 12
  93. 93. Comet:Http Long Polling XMLHttpRequest Pros Can implement good error handling Easy to implement Supported by all the browsers Cons No main disadvantagesMonday, May 14, 12
  94. 94. Bayeux Just a protocol based on httpMonday, May 14, 12
  95. 95. WebSockets Browser Server Timeline TimelineMonday, May 14, 12
  96. 96. WebSockets Browser Server Timeline TimelineMonday, May 14, 12
  97. 97. WebSocketsMonday, May 14, 12
  98. 98. WebSockets WebSockets enables bi-direction, full-duplex communication channel like tcp socketsMonday, May 14, 12
  99. 99. Thanks!Monday, May 14, 12

×