Can I make a non-hosted HTML5 application with local storage?

I have a PHP / MySQL site, I am thinking of converting to HTML5 / JavaScript, which can be run on the user's local computer. I want the user to be able to download my site, retrieve it and use it without a network connection. The static mirror of this site was hundreds of megabytes, and the actual data was less than 10 megabytes. Is there a way to preload the HTML5 web store ahead of time? Or will I have to use JavaScript to load web storage if I don't have data? Any ideas or pointers? Thanks

+4
source share
2 answers

I’m not quite sure what you mean: β€œThe static mirror of this site will have hundreds of megabytes and the actual data will be less than 10 megabytes,” but I believe that the only practical way to read / write from the HTML5 repository is through JavaScript, so when they start your application first, it will need to check if the data exists in the repository, and if it does not populate it from any source using JavaScript. There is no way to preload it except AFAIK.

+1
source

In fact, you will need "Offline Web Applications" for working with HTML5 to serve pages locally (for example, act as a local web server).

Another way to serve web applications locally can be through CouchDB: it is easily installed on Linux (not sure about Windows) and provides an integrated web server, of course, a database. You can push your HTML / JS site to CouchDB from a browser if the user installs the extension (this is easy to do in Firefox and Chrome).

0
source

Source: https://habr.com/ru/post/1299558/


All Articles