Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

224
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!