I have an API call that returns products to be displayed on a Point-of-Sale system. the current account I have has about 7000 products.
Initially I made the API return all products at once, this works for users that have 1-1000 products and the Point-of-Sale loads relatively quickly. However when users have more than 1000 products, the loading of the system takes more than 15 seconds to fetch and load.
So, I changed how the API works. I made the API return 200 products at a time, and the Point-of-Sale has to repeatedly call the API to collect all of them (essentially pagination).
But when doing this, I have introduced a new issue. The Point-of-Sale loads quickly, however there might be a chance that all of the products have not loaded yet. So when using the POS, you might not see everything.
My question is. Is there a better way to handle something like this?