Is localStorage reliable on the iPad?

I see some comments from people suggesting that localStorage on the iPad is unreliable. Can anyone confirm that they are happy to use localStorage on the iPad? I understand that there is a limit of 5 MB, too - is this another question?

thanks

+6
source share
1 answer

I was working on a project that uses localStorage on an iPad. In my experience, localStorage is completely stable. However, there are two things to consider:

  • Yes, the storage limit is still 5 MB. Since characters are stored in UTF16, only 2.5 M characters can be stored in local storage.

  • Unlike other localStorage implementations, localStorage.setItem () does not delete previous items with the same key before saving the new item. In other words: when rewriting an item, you should always call localStorage.removeItem () before calling localStorage.setItem (), or you will quickly run out of space.

+13
source

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


All Articles