Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

340
Vistas
Storing and accessing compressed json files from local storage in react native

I have a couple of JSON files used for animation (used in lottie-react-native) in my react native app. Each file is around 100KB and the total size of all JSON files amounts to 2-3MB. Now my goal is to get rid of this 2-3MB as much as possible. So, should I go for cloud storage of these JSON files, or should compress and store them and then later decompress at the time of use? If I should go with the compress/decompress approach, then please suggest the library as well which would perfectly satisfy my requirement.

over 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

You can use jsonc https://www.npmjs.com/package/jsonc to compress the json files and store them

over 4 years ago · Juan Pablo Isaza Denunciar

0

Well, you can use Cache Storage for this purpose. (Please check ServiceWorker support on browsers. https://caniuse.com/serviceworkers). It will allow you to load the content once, and cache it in user browser. It is working with ServiceWorker technology, which requires an small implementation.

https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage

Or you can implement google's workbox library, which allows you to do same thing in a cleaner way.

https://developers.google.com/web/tools/workbox/guides/get-started#routing_and_caching_strategies

I can't suggest to put all of your json content to localStorage. It's working memory based. It might have performance problems in low memory/cpu computers.

over 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Asistente virtual