长寿命连接(异步服务器推送)与Apache / PHP / JavaScript的?长寿命、服务器、Apache、PHP

2023-09-10 13:29:12 作者:迩幸福就好

我来自更多的是Java的背景。在过去的一年或两年,它变得有些流行做服务器推送通过HTTP使用的长期的HTTP连接的彗星。这是一个非常有用的技术。

I come from more of a Java background. In the last year or two, it's become somewhat popular to do server push over HTTP using long-lived HTTP connections in Comet. It's an extremely useful technique.

所以,我很好奇相当于与Apache + PHP + Javascript的是什么?一个选择,我看到的是只使用直AJAX调用(如使用jQuery),但我真的不知道阿帕奇如何处理它们或如何,我可以实现与PHP的服务器端这样的事情。有任何想法吗?对这种事情有什么好的资源?

So I'm curious what the equivalent is with Apache + PHP + Javascript? One option I see is just using straight AJAX calls (eg with jQuery) but I don't really know how Apache handles them or how I can implement such a thing on the serverside with PHP. Any ideas? Any good resources on this kind of thing?

推荐答案

您可以使用彗星编程技术在PHP。我认为,一个良好的开端是这样的帖子,描述如何在PHP中实现彗星。

You can use Comet programming techniques in PHP. I think a good place to start is this post, describing how to implement Comet in PHP.