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

128
Views
storing 3-4mb of data in frontend/angular app

I need to store about 3-4mb of data (USPS address data mapping zip code to county across the entire US) in the frontend code for fast retrieval. The primary use case is that my users will type in their zip code and I need to tell them what counties they are in.

Storing the data in a plain JSON file in the frontend repo seems like a bad idea because it blows up my app size.

I don't want to retrieve it via an API because the input field performs logic that requires the address data on 500-1000ms delayed keystroke.

My main approach now is to load all the data via API when the app is loaded, and store it into IndexedDB if it doesn't exist already. The annoying part here is it's not obviously "instant" to call an API that returns 3mb of data. An optimization here is that I could just return the data for the county or state that I think the user might be in based on getCurrentPosition() first (unless not allowed), with a follow up async call to return the rest.

Are there any other strategies that I might be missing?

about 4 years ago · Juan Pablo Isaza
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!