title: How do I efficiently load (or background load) autocomplete data for a custom PowerShell prompt?
body: <p>I have experience in writing custom PowerShell prompts and autocompletes. I've mainly used it to build a custom git PowerShell prompt/autocomplete, and it works fine.</p>
  
  <p>I'm now trying to build one for kubernetes. The big problem is the latency of querying the k8s server. For my git prompt, almost all the operations are local, so the latency hit of querying git repeatedly and frequently isn't an issue. Hitting a remote k8s cluster, not so fast.</p>
  
  <p>What is a good approach for dealing with this? I was thinking that I could write a background process that queries k8s and stores the data in a local file that would be used for the prompt/autocomplete, but it seems like there should be a better way.</p>