为网站选择技术。 Ajax 还是推送?
我们正在建立一个网站,其功能类似于 bigdeal.com。我们不会建立拍卖网站或类似网站,但网站的某些部分将根据其他用户的操作频繁更新(类似于 bigdeal.com 上的出价)。每当某个用户引发不同的事件时,该页面就会不断更新。
我们想知道这是否可以仅使用 ajax 来完成,或者是否有必要使用 smartfoxserver.com 或 Pusher.com 之类的
东西
We are building a website with has some functionality similar to bigdeal.com. We are not building an auction site or anything like that, but some sections of the website will be updating frequently given other users actions (similar to bidding on bigdeal.com). The page will be continually updated every time some user causes different events.
We were wondering if this can be done using just ajax, or if its necessary something like smartfoxserver.com or pusher.com
thnks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这实际上取决于实时方面的重要性。例如,对于一个聊天网站来说,推送对于实时沟通至关重要。对于延迟问题不太严重的网站,您可能希望每隔一段时间就使用 AJAX 进行轮询。作为一个现实生活中的例子,Twitter.com 至少曾经在其主页上显示过一些最近的推文。这是由 AJAX 提供支持的,因为并不是每个人都必须在收到每条最新推文后立即看到它。就您的目的而言,AJAX 似乎没问题。
It really depends on how essential the real-time aspect is. For example, for a chat website, push is essential for real-time communication. For a website where latency is less of a problem, you may wish to poll with AJAX every once in a while. As a real life example, Twitter.com at least used to show a few recent tweets on their home page. This was powered by AJAX, as it was not essential for everyone to see every recent tweet coming in as soon as it came in. For your purposes, it looks like AJAX will be alright.