0

I'm trying to find out what's the max length that can be stored in localStorage/sessionStorage objects .

is it a good practice storing maybe big json object (more than 3000 length ) on those storages objects ?

why would i want to do that ? , i'm having a huge amount of requests to the api which slow its performance .

Cru Dy
  • 11
  • 8
  • It depends on the target runtime (in this case the specific browser version) that runs the app. – Aluan Haddad Jan 16 '18 at 08:35
  • 4
    Possible duplicate of [What is the max size of localStorage values?](https://stackoverflow.com/questions/2989284/what-is-the-max-size-of-localstorage-values) – Kaddath Jan 16 '18 at 08:35

1 Answers1

0

From the wikipedia article about LocalStorage on browser :

Web storage provides far greater storage capacity (5 MB per origin in Mozilla Firefox,[6] and Opera; 10MB per origin in Google Chrome,[7] 10 MB per storage area in Internet Explorer;[8] 25MB per origin on BlackBerry 10 devices) compared to 4 kB (around 1000 times less space) available to cookies.

So the best way is to store only data that need to be used in all the app, like user info... Other data can be downloaded or store in a file on server.

Léo R.
  • 2,620
  • 1
  • 10
  • 22