5

To clarify I'm referring to the key/value localStorage pairs, not Web SQL DB or IndexedDB.

Is it strictly a 5MB limit for the iPad, or is it true that it's unlimited but it will ask the user to allow/deny once you exceed 5MB?

I'm hoping to use localStorage to store a large amount of data and so is important that it's unlimited.

Chris
  • 977
  • 4
  • 11
  • 12

4 Answers4

4

Have a look at how the Financial Times web app deals with it:

http://apps.ft.com/ftwebapp/

On installation it detects the limit and then provides instructions for the user to manually increase their limit to 50MB using the Settings app.

If there was an easier/automatic way to do this, I'm sure they'd use it.

Nick Lockwood
  • 40,865
  • 11
  • 112
  • 103
0

Safari mobile is limited at 50mb, if you try to write to local storage over the storage quota it will throw an exception. There is no way to check how much space is remaining, you simply have to try to write and catch the exception. Pretty terrible.

Below are some articles on the limits of the various storage types. The conclusion is Safari mobile sucks.

https://developers.google.com/web/fundamentals/instant-and-offline/web-storage/offline-for-pwa

https://en.wikipedia.org/wiki/Web_storage

https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/bg142799(v=vs.85)#_objmodel:

https://developers.google.com/web/fundamentals/instant-and-offline/web-storage/offline-for-pwa

https://www.html5rocks.com/en/tutorials/offline/quota-research/

Sigex
  • 2,834
  • 2
  • 24
  • 25
0

I know you are looking for localstorage key/value pairs. Just like myself. I tried a native solution and apparently my iPad had 2.5 MB only for localstorage. So I switched to locaForage which is a IndexedDB (+more) wrapper in a very similar to localstorage api. It doesnt have these limitations of localstorage.

lost in binary
  • 544
  • 1
  • 4
  • 11
0

Yes, it's the same limit for iphone and other apple devices as well because of how Safari implemented localStorage. Take a look at this

Limit of localstorage on iPhone?

Community
  • 1
  • 1
Infinity
  • 3,695
  • 2
  • 27
  • 35
  • So beyond 5MB it will ask for permission then increase to 10MB, will it continue to increment with permission or is 10MB the max? – Chris Aug 30 '11 at 16:04
  • 1
    are you sure it's unlimited for the localStorage key/val? I believe the Web SQL DB local storage has a different cap. – Chris Aug 30 '11 at 16:42