服务器推送(Server Push)的思想是由服务器主动发送信息,并与客户端保持连接,直至服务器或客户端有一方自行中断连接为止。
Server Push的优点在于减少了建立、销毁连接的时间,去除了无用的页面刷新,缺点是占用了大量端口和相关系统资源,单纯的Server Push无法支持大用户量的服务。
Server Push使用了multipart/x-mixed-replace这种MIME类型,报文范例格式如下:
Content-type:multipart/x-mixed-replace;boundary=ThisRandomString
–ThisRandomString
Content-type:text/plain
第一个对象的数据
–ThisRandomString
Content-type:text/plain
第二个(最后一个)对象的数据
–ThisRandomString–
每个数据块由三部分组成:一是Content-type之类的头标,二是数据正文,三是报文边界,每当客户端接收到新的头标时,原有文档将被清除,并被新的数据块填充。
Apache和IIS均支持Server Push技术,笔者推荐Linux/Unix下的Apache软件,它可以自由的增删相应模块,以满足较多连接状态下的高性能需求。
If you like this post and would like to receive updates from this blog, please subscribe our feed.
六月 23rd, 2006 at 12:11
网站做的不错 有卖弄技术之嫌
二月 15th, 2008 at 10:02
本人对这项技术不了解,有时间发一个份资料或示例给我,见实一下。多谢。
二月 15th, 2008 at 10:03
哦,Email 看不到啊
Email: vincent860214@126.com
三月 6th, 2008 at 13:28
本人正在研究此项技术,若有demo,请发一份给我,万分感谢!!!
email:huch@allprocap.com
三月 6th, 2008 at 13:29
email地址错了!!sorry
email:huch@allprocpa.com
八月 19th, 2009 at 16:56
我也在整这个技术,如果有这方面的资料,发我一份吧!十分的感谢
七月 2nd, 2010 at 17:10
[...] http://www.rainway.org/2004/10/03/server-push/ [...]