Single Page Application - Reusing

Rajarajacholan Krishnamurthy 21 Reputation points
2020-05-15T10:57:49.317+00:00

I have a single page application with a dashboard. The dashboard has several components and each component is calling a service. As the number of components in the dashboard is getting increased, the number of service calls also increase and I see this hits the performance. I am thinking of making just one call to the service and bundle everything inside the service. Several components in the dashboard almost share the same data in different forms. Would appreciate ideas and suggestions.

Thanks indeed.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,528 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vahid Ghafarpour 16,365 Reputation points
    2023-08-27T02:53:53.8733333+00:00

    Instead of making individual service calls for each component, design your server-side API to handle requests for aggregated data. This way, you can fetch all the necessary data in a single request.

    Depending on your backend technology (REST API, GraphQL, etc.), you can create custom endpoints or queries that retrieve the required data for different components.

    0 comments No comments