简体   繁体   English

Webapp 可以离线工作!

[英]Webapp able to work offline !

I have to design an webapp that has the capability of working offline.我必须设计一个能够离线工作的 webapp。

So there are many working points that in normal mode work online, connected to a central server.所以有很多工作点在正常模式下在线工作,连接到中央服务器。

Now there are moments when for different reasons, the central server might not be available.现在有时由于不同的原因,中央服务器可能不可用。 (no internet,server crash etc) so then is needed to enter in offline work mode. (没有互联网,服务器崩溃等)因此需要进入离线工作模式。 Is not required to work fully just to do some work because clients should not wait, so invoicing should be possible (concrete case).不需要完全工作只是为了做一些工作,因为客户不应该等待,所以应该可以开具发票(具体案例)。

A custom solution I already have in mind but I am wondering if you know a framework or something that does such things already.我已经想到了一个自定义解决方案,但我想知道您是否知道一个框架或已经做这些事情的东西。

Thank you !谢谢 !

We wrote a desktop app for hundreds of employees to use on their laptops.我们编写了一个桌面应用程序,供数百名员工在他们的笔记本电脑上使用。 It used database replication to merge the data from the laptop copy of the database to the server copy of the database.它使用数据库复制将数据从数据库的笔记本电脑副本合并到数据库的服务器副本。 The amount of data contained in the database was significant -- product information, customer contact information, and so on.数据库中包含的数据量很大——产品信息、客户联系信息等等。 That was all needed for the rep to be able to create sales orders and invoices and the like.代表能够创建销售订单和发票等所需的一切。 It was crucial that the rep be able to use the software all the time, not just once in a while when they had connectivity.代表能够一直使用该软件至关重要,而不仅仅是在他们有连接时偶尔使用。 However, this approach does have its challenges -- if the local databases don't get synched up frequently, data at both ends becomes stale, plus you have to deal with conflicing updates.但是,这种方法确实有其挑战——如果本地数据库不经常同步,两端的数据就会变得陈旧,而且您必须处理相互冲突的更新。

If the amount of database information needed locally for working disconnected isn't huge, you definitely can take advantage of the new HTML5 offline storage and use a website.如果离线工作所需的本地数据库信息量不是很大,您绝对可以利用新的 HTML5 离线存储并使用网站。

I think that the critical factors here are how much data the user needs when they are working offline, how fresh the data needs to be, and what percentage of time they will be working online vs. offline.我认为这里的关键因素是用户在离线工作时需要多少数据,数据需要多新鲜,以及他们在线和离线工作的时间百分比。

If your app is html/javascript, use the HTML5 application manifest.如果您的应用程序是 html/javascript,请使用 HTML5 应用程序清单。 See the following resources请参阅以下资源

http://www.w3.org/TR/offline-webapps/ http://www.webreference.com/authoring/languages/html/HTML5-Application-Caching/ http://www.w3.org/TR/offline-webapps/ http://www.webreference.com/authoring/languages/html/HTML5-Application-Caching/

You can use Google Gears .您可以使用谷歌齿轮

Here is another link: http://www.scriptol.com/ajax/google-gears.php这是另一个链接: http://www.scriptol.com/ajax/google-gears.php

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

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