0

We are building an HTML5 website that has an eBook reader built in. One of the main features of the website is that the user should be able to access the books that were downloaded while he/she is not connected to the internet. This functionality should be available on all tablets, Chrombooks, and desktops.

My questions are:

  1. Is there a way for the user to be able to read the books even though the internet is gone? I realise that there is support for local storage but what happens if the user closes the tab while he/she is offline?
  2. Are there any local storage constraints? We will rely on the user being able to store books, and many of them (could exceed 3-400 MBs)? Can we force store this data without it being purged? As in, storing it somewhere other than the temp folder?

The main question is, how do I cold load the website from an offline machine right after launching the browser assuming I have all the local data available in the local storage from the last session.

Iván Rodríguez Torres
  • 4,293
  • 3
  • 31
  • 47
  • This is a bit too broad. [Start here](https://www.google.com/search?q=html5+offline) and ask again you have a specific question. – JJJ Jun 30 '16 at 15:17
  • I'm not aware of a way to fully offline a website in the browser - even with really aggressive caching, I suspect DNS would be an issue. Local storage has limited space (so sites don't fill up your HD) - http://stackoverflow.com/questions/2989284/what-is-the-max-size-of-localstorage-values seems to indicate 5-10MB per domain name. Chances are you'll need some sort of app that wraps the site. – ceejayoz Jun 30 '16 at 15:17

1 Answers1

0

You can have an offline version of your site using the HTML5 capabilities, as de application cache (appcache). Here you have a good starting point.

Then, local storage is very limited for your purpose, in addiction, it depends on each browser, here you could find some info about the quota on each one.

If you focus on webkit browsers, like Safari or Chrome, you could use the FileSystem API,which allows to store files on the device. In this article you have a better aproach to the subject.

Iván Rodríguez Torres
  • 4,293
  • 3
  • 31
  • 47