I have an ASP.NET Core MVC application that interacts with an external API.
My application has four pages, and each page requires a list of orders from the API. The API response time for these requests ranges from 8 to 15 seconds due to the large amount of data.
This causes a significant delay every time I navigate between pages since each request fetches fresh data from the API.
What are my options to optimize this?
Caching the data is not ideal because orders are frequently updated, and I need the most up-to-date information.
Storing the data in my database and subscribing to their webhooks (for order creation and updates) seems like a good approach, but it might lead to a massive number of database writes and queries.
Are there better solutions to handle this efficiently? Any best practices for dealing with such cases?