强制从外部页面刷新网页 [英] Force webpage refresh from external page

查看:35
本文介绍了强制从外部页面刷新网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这种情况:100 台计算机正在显示一个网页,我可以从后端更新此网页.

I have this situation: 100 computers are displaying a webpage and from a backend I can update this webpage.

而且我希望我的 100 台计算机上显示的网页能够自动更新.

And I would like that the webpage displayed on my 100 computers is automatically updated.

有没有办法在不轮询的情况下刷新/更新页面?最好的方法是外部页面可以强制页面重新加载,但我认为这是不可能的.

Is there a way to refresh/update the page without polling? The best way it will be that an external page can force the page to reload, but I think that's not possibile.

谢谢

M.

推荐答案

在最近的浏览器上,有一个 websockets 的实现,允许服务器将数据推送到客户端.它只适用于某些网络服务器(tomcat 7、node.js 等...)Websocket 规范在这里.

On recent browsers, there is an implementation of websockets that allow the server to push data to the clients. It only works on some webservers though (tomcat 7, node.js, etc...) Websocket spec is here.

另一种方法是长请求,其中客户端启动一个 http 请求,服务器仅在它有东西要发送给客户端时才响应.

An other method is the long request in which the client starts an http request, and the server only answers when it has something to send to the client.

更多信息此处.

这篇关于强制从外部页面刷新网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆