1

I have a JSON Data to store in local storage which is being used by a lot of components in my application. In some cases, the data exceeds 100 Mb and my browser throws an error, "localStorage.setItem exceeded the quota". But it is very important for me to cache this data as downloading with slow down my application. Could some suggest me a simple and effective way of achieving this?

khushboo j
  • 21
  • 1
  • 5

1 Answers1

1

Try having the data compressed. This might help depending on your JSON data. https://coderwall.com/p/mekopw/jsonc-compress-your-json-data-up-to-80 This api says it compresses up to 80% of data in a JSON string.

I believe this is the JS file from it https://github.com/tcorral/JSONC/blob/master/src/JSONC.js