Web application server out of the air and client application takes position

1

I would like to know if there is a way for a client application to take over when the server is down, as if it were a Dropbox, for example, you can put a file, or a directory inside the folders that are synchronized through the program (Dropbox) and it will only be synchronized when the computer is connected to the Internet or when the Dropbox server comes back on the air. But speaking now in web application, can you do that? The Internet crashed or the server was left on the next request in which the connection did not give return signal the server will redirect to a web page or some feature in the browser inside the computer itself where the user can do a certain operation once it is reestablished the connection the client data will be synchronized with the server without losing any information and the user realizes that the connection with the site has fallen.

    
asked by anonymous 05.10.2015 / 15:19

1 answer

2

There is way yes, from html 5 there is a proper specification for offline app, in addition there are several apis that facilitate the caching of resources to take over when the server for some reason is offline. After all, this work is not trivial, nothing is done "automatically". I'll leave you some links so I can check it out.

Offline page specification: link Very good article on the subject: link

So far the problem of offline pages has been solved, in addition, you will need to save the data with the changes of the user to later transmit to the server, in the html 5 specification there are 2 alternatives, Web Sql Database and Web Storage. p>

In the case of Web Sql Db, it is basically a Sqlite database, that is, with minimal persistence functions, that the browser itself offers, you can see an example of how to use it here: link

As for web storage, it's something like a key map and local value also offered by the browser, it's almost a cookie but it's not sent to the server, you can see more information on how to use it here: link

    
05.10.2015 / 18:03