Suche senden
Hochladen
Hello serversentevent(cn)
•
Als PPTX, PDF herunterladen
•
1 gefällt mir
•
833 views
G
g65537
Folgen
Melden
Teilen
Melden
Teilen
1 von 11
Jetzt herunterladen
Empfohlen
ผังงาน
ผังงาน
jutamat
เอ็ม
เอ็ม
jutamat
لائحة انماء العدوسية
لائحة انماء العدوسية
joseph
Workshop - Social Media For Startups
Workshop - Social Media For Startups
ucla1985
Robinson and hardin business platform
Robinson and hardin business platform
Marques Hardin
Gestalt Foundation Overview
Gestalt Foundation Overview
The Gestalt Foundation, Inc.
Portfolio Works
Portfolio Works
minimaki88
揭秘Html5和Css3
揭秘Html5和Css3
Adam Lu
Empfohlen
ผังงาน
ผังงาน
jutamat
เอ็ม
เอ็ม
jutamat
لائحة انماء العدوسية
لائحة انماء العدوسية
joseph
Workshop - Social Media For Startups
Workshop - Social Media For Startups
ucla1985
Robinson and hardin business platform
Robinson and hardin business platform
Marques Hardin
Gestalt Foundation Overview
Gestalt Foundation Overview
The Gestalt Foundation, Inc.
Portfolio Works
Portfolio Works
minimaki88
揭秘Html5和Css3
揭秘Html5和Css3
Adam Lu
揭秘Html5和Css3 ---- 鲁超伍
揭秘Html5和Css3 ---- 鲁超伍
裕波 周
Html5css3 go.yeefe.com
Html5css3 go.yeefe.com
tellyeefe
WEB 安全基础
WEB 安全基础
xki
高性能网站最佳实践
高性能网站最佳实践
longhao
让我们的页面跑得更快
让我们的页面跑得更快
li qiang
TBAD F2E 2010 review
TBAD F2E 2010 review
leneli
Exam 98-375 HTML5 Application Development Fundamentals
Exam 98-375 HTML5 Application Development Fundamentals
Chieh Lin
G2 g画图分享
G2 g画图分享
fangdeng
Ajax Transportation Methods
Ajax Transportation Methods
yiditushe
淘宝新首页开发实践
淘宝新首页开发实践
chencheng 云谦
Jsp讲义
Jsp讲义
yiditushe
运维系统开发与Rails 3页面开发实践
运维系统开发与Rails 3页面开发实践
Li JianYe
四天学会Ajax
四天学会Ajax
Kelvin Zhong
Real time web实时信息流推送
Real time web实时信息流推送
yongboy
Real-Time Web实时信息流推送
Real-Time Web实时信息流推送
yongboy
Node Web开发实战
Node Web开发实战
fengmk2
Timers in Browser
Timers in Browser
j5726
[2008]网站重构 -who am i
[2008]网站重构 -who am i
Twinsen Liang
Re Introduce Web Development
Re Introduce Web Development
finian lau
HTML & JavaScript
HTML & JavaScript
Sanji Zhang
Weitere ähnliche Inhalte
Ähnlich wie Hello serversentevent(cn)
揭秘Html5和Css3 ---- 鲁超伍
揭秘Html5和Css3 ---- 鲁超伍
裕波 周
Html5css3 go.yeefe.com
Html5css3 go.yeefe.com
tellyeefe
WEB 安全基础
WEB 安全基础
xki
高性能网站最佳实践
高性能网站最佳实践
longhao
让我们的页面跑得更快
让我们的页面跑得更快
li qiang
TBAD F2E 2010 review
TBAD F2E 2010 review
leneli
Exam 98-375 HTML5 Application Development Fundamentals
Exam 98-375 HTML5 Application Development Fundamentals
Chieh Lin
G2 g画图分享
G2 g画图分享
fangdeng
Ajax Transportation Methods
Ajax Transportation Methods
yiditushe
淘宝新首页开发实践
淘宝新首页开发实践
chencheng 云谦
Jsp讲义
Jsp讲义
yiditushe
运维系统开发与Rails 3页面开发实践
运维系统开发与Rails 3页面开发实践
Li JianYe
四天学会Ajax
四天学会Ajax
Kelvin Zhong
Real time web实时信息流推送
Real time web实时信息流推送
yongboy
Real-Time Web实时信息流推送
Real-Time Web实时信息流推送
yongboy
Node Web开发实战
Node Web开发实战
fengmk2
Timers in Browser
Timers in Browser
j5726
[2008]网站重构 -who am i
[2008]网站重构 -who am i
Twinsen Liang
Re Introduce Web Development
Re Introduce Web Development
finian lau
HTML & JavaScript
HTML & JavaScript
Sanji Zhang
Ähnlich wie Hello serversentevent(cn)
(20)
揭秘Html5和Css3 ---- 鲁超伍
揭秘Html5和Css3 ---- 鲁超伍
Html5css3 go.yeefe.com
Html5css3 go.yeefe.com
WEB 安全基础
WEB 安全基础
高性能网站最佳实践
高性能网站最佳实践
让我们的页面跑得更快
让我们的页面跑得更快
TBAD F2E 2010 review
TBAD F2E 2010 review
Exam 98-375 HTML5 Application Development Fundamentals
Exam 98-375 HTML5 Application Development Fundamentals
G2 g画图分享
G2 g画图分享
Ajax Transportation Methods
Ajax Transportation Methods
淘宝新首页开发实践
淘宝新首页开发实践
Jsp讲义
Jsp讲义
运维系统开发与Rails 3页面开发实践
运维系统开发与Rails 3页面开发实践
四天学会Ajax
四天学会Ajax
Real time web实时信息流推送
Real time web实时信息流推送
Real-Time Web实时信息流推送
Real-Time Web实时信息流推送
Node Web开发实战
Node Web开发实战
Timers in Browser
Timers in Browser
[2008]网站重构 -who am i
[2008]网站重构 -who am i
Re Introduce Web Development
Re Introduce Web Development
HTML & JavaScript
HTML & JavaScript
Hello serversentevent(cn)
1.
Html5 <html5> <figure>Server-Sent
Event</figure> <a href='mailto:leonguo@sohu-inc.com'>leonguo</a> <time>2010.10</time> </html5>
2.
Agenda 一个广泛的适用场景 现阶段采用的一些解决方案及不足(AJAX、Comet)
规范(html5 Server-Sent Event) 实例 更多细节 Q&A
3.
In many cases
只需要服务端实时的向浏览器推送就可以了 Example: 在线人数实时统计 球赛实况 股票实时动态 新闻公告板
4.
The current scheme
Polling Ajax 浪费了大量连接、流量与时延 Comet(Ajax/Iframe) 缺乏统一的标准 实现复杂
5.
Server-Sent Events Server-Sent
Events(SSE) 实际上是将 Comet 技术进行了标准化 规范和标准化了一个连续的数据流如何被从服务端发送到浏览器 SSE 包含新的HTML元素 EventSource 和新的 MIME 类型 text/event-stream,这个MIME类型定义了事件框架格式。
6.
API client.js
document.addEventListener('DOMContentLoaded', function() { var eventSrc = new EventSource('events.php'); eventSrc.addEventListener('open', function (event) { console.log(event.type); }); eventSrc.addEventListener('message', function (event) { console.log(event.type); console.log(event.data); }); }, false); events.php <?php header("Content-Type: text/event-stream"); echo 'data: ' . time() . "";
7.
A Original Demo
8.
More 使用共享的 WebWorker,共享
EventSource 实例 尽量在没有其它数据发送时定期发送 keep-alive 注释,以防被当作空闲连接被代理服务器关闭, 尽管sever-sent events 会自动重建连接 在 Response header 中标记 Cache-Control:no-cache 避免被缓存 可以结合使用 Request 中的 Last-Event-Id 防止重复接受已经接收到的事件
9.
Browser Support for
SSE 和 WebSocket 相比比较沉默 http://www.findmebyip.com/litmus#target-selector 目前已经支持的包括 WebKit(safari/chrome) Opera Firefox Beta
10.
Q&A
11.
THANKS
Jetzt herunterladen