Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

226
Visualizações
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.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

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

about 4 years ago · Juan Pablo Isaza Relatório

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.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda