1

I've asked question about JavaScript memory and HTML5 LocalStorage limitations on smartphones, however the problem became a bit more specific.

I need to store for offline usage a lot more data, big part of it are dictionaries. I had an idea to store dictionaries in JavaScript (which loads simply array data into JS variable) which will be cached for offline usage. Business data for offline will be stored in LocalStorage. Additionally JS memory will hold some cache for online usage, to prevent loading same entity more than one time from server.

So I have question, if using big offline cache (say 4MB) and storing a lot in memory affects the storage available for LocalStorage? Say it can become limited to 3MB because of heavy offline cache usage. Does someone has experience with such applications and had to deal with problems with particular browsers on mobile devices?

The answer to similar to mine question Application Cache Manifest + Local Storage Size Limit does not provide the information I need since as fair as I understood the author has tested offline cache limit and LocalStorage limit separately.

Even more I'm worried about JS memory applications, I fear the browser can be closed without even warning. Testing on one device would not mean the application would not crash on another, less powerfull.

So please write, if you have tested the limits of mobile browsers. Post which only give clues where to search further or describe test scenarios which hasn't finished with effort will also be appreciated. The topic is quite new so I'm aware most of researches are drafts only.

update I've updated my referred question about LocalStorage limitations, with test on Opera Mobile 11, in which I was able to store much above 5MB limit.

Also according to the post Increase iPad cache over 50 MB? at least on iPad it is possible to store 50MB of data, hope I would do test on iPhone soon.

Community
  • 1
  • 1
Danubian Sailor
  • 1
  • 38
  • 145
  • 223

2 Answers2

2

In almost all cases, mobile devices have a hard, 5meg limit for all storage for a domain. That includes all of the local/session storage, indexed db, websql, application cache or anything else.

The best way to store data in this case is either to use local storage or WebSQL for your dictionary data, but instead of storing all of the data, store the 80% use case content, and provide an easy way to be able to load the additional information as necessary.

HTH, PEte

PeteLe
  • 1,755
  • 10
  • 19
  • 1
    The problem is, in offline mode there's no way to load additional information. Anything needed must be made available before. – Danubian Sailor Nov 17 '11 at 08:20
0

After experimenting a bit, I've found out that Opera is not limiting the resources. It asks to increase LocalStorage limit, and this limit is not affected by storing files in application cache.

Firefox has configurable LocalStorage limit so in theory it is possible to store large amount of data there, also unaffected by application cache. However, Mobile Firefox is so badly written as its desktop brother and it manages resources so ineffectively that it is killed by Android when the storage is in intensive use. So I would discourage people to use Firefox, at least on Android devices.

Android Browser, on the other way, seems to have 2,5 MB limit, which is unaffected by application cache, however it is lower as it should be, according to suspitions that you have at least 5MB for use. However, this browser also fail to provide accurate GPS location (which is, AFAIK, feature not bug - security reasons), so for me this browser is no option to support.

Danubian Sailor
  • 1
  • 38
  • 145
  • 223