在本地网络中共享 HTML5 离线缓存?
好的,我知道 HTML 本身还没有完成,而且我已经阅读了 HTML5 的离线模式。
问题是:
我是否可以设置一个离线应用程序,使整个系统离线工作,并与同一网络中的其他客户端共享缓存(或 XML 存储库,或 SQL-Lite DB 等)?
例如,我的系统运行在需要在本地网络内相互共享信息的客户端上,但它完全基于网络。万一本地网络的路由器死机,这些客户端如何继续相互通信?
===结束===
注意:如果您仍然不清楚,我建议您继续阅读。以下信息是为了进一步阐明我想要的内容。
如果您仍在阅读,这里有一个详细的示例:
一家餐厅中有 4 个人正在使用基于网络的订购系统。他们每人都有一个 iPod Touch(笑),通过 Wifi 连接到互联网。每个成员都使用共享帐户登录系统,这使得他们可以共享信息。厨师也已连接,但使用厨房中安装的 iPad(哈哈)。
当服务员记录订单时,数据存储在数据库中,并使用AJAX不断刷新厨师的屏幕,因此他会立即收到通知。
假设宙斯切断了餐厅的电源。
现在,没有互联网连接,但所有有问题的设备仍然可以运行,这要归功于其固有的电池导向特性。
Web 应用程序切换到离线模式,并利用缓存的菜单和屏幕。
但!
离线系统如何在客户端设备之间共享信息? iPod Touch #3 如何告诉厨师的 iPad - “嘿,这是订单 #5352”?
最明显的想法是共享缓存或其他东西......
想法?
Ok, so I know that HTML in itself isn't done yet, and I've done my fair share of reading for HTML5's offline modes.
Here's the question:
Can I set up an offline app in such a way that the entire system works offline, and SHARES a cache (or an XML repository, or a SQL-Lite DB or something) with other clients in the SAME network?
For example, my system runs on clients that need to share information with each other within a local network, but its fully web based. In case the local network's router dies, how can these clients continue to communicate with one another?
=== END ===
NOTE: If you're still not clear, I'd recommend you read on. The information below is to further clarify what I want.
In case you're still reading, here's a detailed example:
4 people in a restaurant are using a web based ordering system. They each have an iPod Touch (lol) which is connected to the internet via Wifi. Each member logs in to the system under a shared account, which allows them to share information. The cook is also connected, but uses a mounted iPad (lolz) in the kitchen.
When a waiter records an order, the data is stored in a DB, and AJAX is used to constantly refresh the Cook's screen, so he is notified instantly.
Assume, Zeus struck down the electricity in the restaurant.
Now, there's no internet connection, but all devices in question still function thanks to their inherent battery-oriented nature.
The web app switches to offline mode, and utilizes cached menus and screens.
BUT!
How does the offline system share information between client devices? How does the iPod Touch #3 tell the Cook's iPad - "Hey there, this is order #5352"?
The most obvious thought is a shared cache or something...
Ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那是不可能的。没有服务器,网页就无法通信。
您唯一能做的就是设置一个本地服务器,以防互联网上的服务器离线或无法访问。
That is not possible. WebPages cannot communicate without a server.
The only thing you could do is setting up a local server for the case that the server on the internet is offline or not reachable.