2. Who am I
Eduard Trayan
Software developer at EPAM Systems
Zend PHP 5.3 Certified developer
SensioLabs Certified Symfony Developer
eduardtrayan@gmail.com
2
3. Agenda
Say some words about real-time
web
Do small overview about possible
solutions
And play game
3
6. Real-time web
Set of technologies and practices
Receiving information as soon as possible
Users doesn't need to check updates
http://en.wikipedia.org/wiki/Real-time_web
6
22. Ajax long polling -
opportunities
Cross-domain requests
Unidirectional communications between client
and server
Binary or text data
Or the same opportunities as provided by
XMLHTTPRequest
22
23. Ajax long polling -
disadvantages
Big delay between event and notification
Big number of requests
Big incoming traffic
Caching by browsers
Possible problems with proxy
23
24. What solution does facebook
use for chat?
1. Ajax long polling
2. WebSockets
3. Forever iframe
4. Proprietary solutions
24
26. Forever iframe - opportunities
Cross-domain requests
POST requests
Unidirectional communications
between client and server
26
27. Forever iframe - disadvantages
Load indication
Script buffering
Page buffering
Proxy buffering
Impossible to compress data
Changes in browser’s history
Hard to detect disconnections/errors
27
28. What solution does vk.com
use for chat?
1. WebSockets
2. JSONP long polling
3. Ajax long polling
4. Proprietary solutions
28
30. ActiveXObject - opportunities
Cross-domain requests
POST requests
Unidirectional communications
between client and server
30
31. ActiveXObject - disadvantages
IE only
Script buffering
Page buffering
Proxy buffering
Impossible to compress data
Changes in browser’s history
Hard to detect disconnections/errors
31
32. What solution does vseti.by
use for chat?
1. Forever iframe
2. Proprietary solutions
3. ActiveXObject htmlfile
4. Ajax long polling
32
34. SSE - opportunities
Multiline messages
Cross-domain requests
Unidirectional communications between client and server
Custom events
Automatic reconnect
Error handling
Control of events
34
35. SSE - disadvantages
Doesn’t work in IE
Doesn’t work in android browsers
<4.4
Impossible to compress data
35
36. What solution does
assistent.by use?
1. Forever iframe
2. Proprietary solutions
3. ActiveXObject htmlfile
4. Ajax long polling
36
38. XMLHTTPRequest interactive
state -opportunities
Cross-domain requests
Unidirectional communications between client
and server
Binary or text data
Or the same opportunities as provided by
XMLHTTPRequest
38
39. XMLHTTPRequest interactive
state -disadvantages
Doesn’t work at <IE10
Unsupported by mobile browsers
Impossible to compress data
39
40. What solution does flowdock
use for chat?
40
1. Forever iframe
2. Proprietary solutions
3. WebSockets
4. Ajax long polling
47. Ajax polling - opportunities
Cross-domain requests
Unidirectional communications between client
and server
Binary or text data
Or the same opportunities as provided in
XMLHTTPRequest
47
48. Ajax polling - disadvantages
Big delay between event and notification
Big number of requests
Big incoming traffic
Caching by browsers
48
51. WebSocket - opportunities
Bidirectional communications between client and
server
Cross-domain requests
Binary or text data
Usage of extensions and subprotocols
51
52. WebSocket - disadvantages
Doesn’t work at <IE10, android
browsers <4.4, iOS Safary <6.0,
Safary <6
Possible problems with proxy
52