Currently, I am working on an Angular application that retrieves data from a REST server. Each piece of data we retrieve contains essential "core" information for basic representation, as well as additional "secondary" data like comments and other optional details that users may or may not want to see.
I am striving to optimize our request process in order to reduce the time users spend waiting for a loading spinner to complete. Initially, fetching all core and secondary data simultaneously results in a slow response time, but only retrieving the essentials until a user requests more data can lead to unnecessary delays if they end up needing it while reading the initial content.
As of now, my approach involves pulling core content first and then triggering a secondary data retrieval after the success callback from the initial request. While this is still experimental, I am curious about any established best practices in this scenario. (I could certainly search online for answers, but I'm unsure of what specific keywords to use, hence the quotes in the title of this question)
One specific question I have is whether it's better to initiate numerous small HTTP transactions or a few large ones. My inclination leans towards multiple small requests, especially if I can predict which additional data users are most likely to need promptly. However, I wonder if there is a threshold where this approach becomes less efficient. Am I on the right track with this strategy, or should I reconsider my thinking altogether?