COMET 相对于 AJAX 的可能性

发布于 2024-10-06 06:23:11 字数 91 浏览 0 评论 0原文

我最近开始了解 COMET 以及它如何在不接收来自页面本身的请求的情况下与客户端页面相对应。但我想知道这种技术有哪些可能性,与 AJAX 相比,这种技术非常高效且简单。

I recently came to know about COMET and how it can correspond to the client page without receiving a request from the page itself. But I was wondering what are the possibilities that arrives with this techniques, which is very efficient and easy in comparison to AJAX.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

烟酉 2024-10-13 06:23:11

More and more chat web sites :-)

Now seriously, being part of the HTML5 specification, the WebSocket API allows servers to push data to the client. A big advantage for this is that clients will no longer need to continuously poll the server for updates, when updates are available servers will push data to the client and notify him for those updates, which would preserve bandwidth and allow more efficient applications. Modern browsers already support it. On the other hand an additional server is needed for handling the protocol.

薄荷港 2024-10-13 06:23:11

现在 comet.comet 的时间是反向 ajax。如果您在聊天应用程序中使用 ajax,则需要每次检查数据库更新,但在 comet 的情况下,所有内容都与服务器端事件有关。我们可以设置某些事件@服务器端然后当数据库更新时它会自动更新网页。也就是说我们不需要一直发出请求。这样我们就可以避免由于大量请求而导致服务器头痛,并且应用程序会更快。

这是一个使用 comet 的实时聊天示例。查看一下:www.zeitoun.net/articles/comet_and_php/start

its Beyond ajax

Now its the time of comet.comet is reverse ajax.If you are using ajax in chat applications u need to check everytime for database updations but in the case of comet its all about server side events.We can set the certain events @server side then it will automatically update the webpage when the database is getting updated.that is we dnt need to give requests all the time.So that we can avoid the server headache due to large no.of requests and the application will be very much faster.

This is a live chat example using comet.check it out:www.zeitoun.net/articles/comet_and_php/start

its beyond ajax

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文