LAMP架构和推送技术
这个问题有点盲目,我什至不确定它是否有意义。
尽管如此:我已经习惯了良好的 ol' LAMP 服务器设计,但倾向于觉得我可以使用一些好的推送技术,而不是非常低效的重复 AJAX 调用来提取新数据(如果有的话)。有没有办法在没有Java servlet(即使用Apache/PHP)的情况下实现这一点? HTML5 是否给朝这个方向迈出一步带来希望?
我研究了 Comet 技术,但看起来它只是长轮询 AJAX,这只是伪造的推送技术(我真的不知道,但它听起来不像是一种有效的推送方式......只是一种有效的方式) 。
This question is a bit of a shot in the dark and Im not even sure it makes sense at all.
Still : Im quite used to the good ol' LAMP server design but tend to feel I could use some good push technology instead of the very inefficient repeated AJAX calls to pull new data, if any. Is there any way to achieve this without Java servlets (ie using Apache/PHP) ? Is HTML5 giving any hope for a step in that direction ?
I looked into Comet technology but it looks like it's just long-polling AJAX, which is just faking a push technology (I don't really know but it doesnt sound like an efficient way to do push... just a way that works).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议阅读以下内容: http: //today.java.net/article/2010/04/26/html5-server-push-technologies-part-2 作为 HTML5 Web 套接字和 http://www.indicthreads。 com/1525/building-real-time-web-applications-using-html-5-web-sockets/。进一步的谷歌搜索将产生更多信息。这看起来像是在功能最强大的浏览器中进行推送的方式,因为它比替代的 HTML5 之前的技术具有优势。
至于 PHP 作为服务器端点,这里有一些阅读内容: http://code.google.com/p /phpwebsocket/ 和 http://www.murraypicton.com/2010/07/websockets-and-php/ 这看起来确实是可能的。
使用 HTML5 websockets 的缺点是它仅在某些浏览器中受支持,因此如果您想要广泛的跨浏览器支持,您还必须实现替代方法。
I'd suggest reading this: http://today.java.net/article/2010/04/26/html5-server-push-technologies-part-2 as an introduction to HTML5 web sockets and http://www.indicthreads.com/1525/building-real-time-web-applications-using-html-5-web-sockets/. Further Google searches will yield a lot more info. This looks like the way to do push in the most capable browsers as it has advantages over the altenative pre-HTML5 technologies.
As for PHP being the server end point, here's some reading: http://code.google.com/p/phpwebsocket/ and http://www.murraypicton.com/2010/07/websockets-and-php/ and it sure look possible.
The disadvantage of using HTML5 websockets is that it's only supported in some browsers so if you want wide cross-browser support, you will also have to implement an alternate method.