1

Are there any storage limits imposed on indexeddb for Android Cordova/Phonegap app, like localStorage does (5MB). If yes, then how can i explicitly ask the user to grant more disk space for the db? I tried finding some plugins but failed. I want to store JSON objects and file blobs.

Here I read, that 300MB has been tested safely: https://stackoverflow.com/a/20675480/3134961

Devashish
  • 1,260
  • 1
  • 10
  • 21

2 Answers2

3

Raymond CAMDEN has written a very interesting article that will guide you : https://www.raymondcamden.com/2015/04/17/indexeddb-and-limits

You can also read this :

The shared pool can be up to 1/3 of the of available disk space.

Storage already used by apps is included in the calculation of the shared pool; that is to say, the calculation is based on (available storage space + storage being used by apps) * .333 .

Each app can have up to 20% of the shared pool.

As an example, if the total available disk space is 60 GB, the shared pool is 20 GB, and the app can have up to 4 GB. This is calculated from 20% (up to 4 GB) of 1/3 (up to 20 GB) of the available disk space (60 GB).

(https://developer.chrome.com/apps/offline_storage#temporary)

Enzo B.
  • 2,341
  • 1
  • 11
  • 33
1

It may be best to store your data in a native SQLite DB via a plugin such as cordova-sqlite-storage, since there is no storage limit.

Also note that on iOS all Webview data (including IndexedDB) is considered cache data which means the OS can wipe it if storage space becomes low on the device.

DaveAlden
  • 30,083
  • 11
  • 93
  • 155