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

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