Comet 与当前技术的兼容性

发布于 2024-07-13 11:44:50 字数 218 浏览 8 评论 0原文

我听说我可以使用 Comet 作为服务器推送技术以及我的 Ajax 代码提高我的网络应用程序的性能。

这项彗星技术有多成熟?

所有网络服务器、编程语言和浏览器都支持它吗?

使用 Comet 有什么缺点?

I hear that I can use Comet as a server push technology along with my Ajax code to increase the performance of my web applications.

How mature this Comet technology?

Is it supported by all web servers, programming languages and browsers?

What are the disadvantages of using Comet?

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

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

发布评论

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

评论(3

一生独一 2024-07-20 11:44:50

它已经成熟了,但我认为你应该更多地将它视为一种技巧而不是技术。

据我所知,所有 Web 服务器都支持它,但如果您正在构建 Comet 应用程序,则需要研究和配置特定的 Web 服务器,因为对资源的需求有点不同。 具体来说,将有更多的同时打开的连接到您的服务器。 在编程语言支持方面,如果您选择的服务器语言具有任何类型的阻塞或等待机制,则可以支持服务器推送。 所有浏览器也都支持它,因为从浏览器的角度来看,这只是一个需要很长时间才能返回的http(s)连接。

在浏览器世界中,有一些缺点,最大的缺点可能是某些浏览器将特定 URL 的打开连接数限制为两个。 因此,如果您有一个服务器阻塞连接打开等待某些推送的数据,则浏览器只能使用一个连接来从服务器获取数据。 可以通过将资源分散到几个二级域以允许浏览器打开更多连接来缓解这种情况。

It is mature, though I think you should consider it more of a technique than a technology.

All web servers support it as far as I know, though you will need to research and configure your particular web server if you are building a comet application as the demands on the resources are a bit different. Specifically, there will be far more simultaneous open connections to your server. In terms of programming language support, if your server language of choice has any sort of blocking or waiting mechanism, you can support server-push. All browsers support it as well, as from the perspective of a browser, this is simply an http(s) connection that takes a long time to return.

There are a couple of disadvantages, in the browser world, the biggest is probably the fact that some browsers limit the number of open connections to a specific URL to two. So if you have a server blocking connection open waiting for some pushed data, you are down to only one connection available for the browser to get data from the server. This can be mitigated by spreading your resources over a few second level domains to allow the browser to open more connections.

黎歌 2024-07-20 11:44:50

“所有网络服务器都支持”这个说法有点奇怪。 大多数实现本身就是一个服务器,您需要找到一个与您想要使用的语言集成的服务器。

也就是说,我在一家公司工作,该公司构建了一个与服务器(特别是 IIS)集成的服务器。

如果您不想费心处理服务器集成(处理不同语言、处理缩放等),请查看 websync - 该服务可让您轻松集成任何语言,因为它是托管的,但支持代理< /a> 通过您自己的服务器请求,以便您可以添加自己的业务逻辑、日志记录、权限等。

"Supported by all web servers" is a bit of an odd statement. Most implementations are a server in and of themselves, and you'll need to find a server that integrates with the language you want to use.

That said, I work at a company that built one to integrate with a server, specifically IIS.

If you don't want to bother dealing with the server integration (dealing with different languages, handling scaling, etc), check out websync - the service lets you integrate any language easily, since it's hosted, but supports proxying requests through your own server so you can add your own business logic, logging, permissioning, etc.

乖乖公主 2024-07-20 11:44:50

实际上,在有关 AJAX 的大肆宣传之前,Comet 就已投入使用:它只是旧想法的新名称。 人们长期以来一直使用隐藏的 iframe 来模拟服务器推送,没有出现任何问题。

Comet was actually in use before all the hype about AJAX started: It's just a new name for an old idea. People have been using hidden iframes to emulate server pushing for a long time without problems.

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