简体   繁体   English

缓存网页的数据供稿

[英]cache data feed for webpage

I'm still a novice website builder, so please go easy on me ... 我仍然是新手网站建设者,因此请放心...

I am displaying a webpage onto a TV viewable to the public. 我正在将网页显示在可供公众观看的电视上。 There is a networked media player behind the TV which plays the webpage, it's not a PC. 电视后面有一个网络媒体播放器,可以播放网页,而不是PC。

The webpage displays regularly updated data which comes from a MySQL database, and I simply use a page refresh to update the webpage. 该网页显示来自MySQL数据库的定期更新数据,而我只是使用页面刷新来更新该网页。 So everything works well, however ... if there is a loss of internet connection, then of course an error appears on the TV when the page refreshes. 因此,一切正常,但是...如果互联网连接中断,则页面刷新时,电视上当然会出现错误。

Is there a way to remove the page refresh, have a piece of code that will still retrieve the data in the background, and ideally cache that data so that even if there is a loss of internet the TV will still continue to display correctly (even if the data is slightly outdated) ? 有没有办法删除页面刷新,有一段代码仍会在后台检索数据,并且理想地缓存该数据,以便即使互联网中断,电视仍将继续正确显示(即使如果数据稍微过时)?

Many thanks. 非常感谢。

Sounds like a job for AJAX. 听起来像是AJAX的工作。 You could also look into service workers. 您也可以调查服务人员。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM