1.

How do you prevent two network calls if multiple components are attempting to make an HTTP call to the same URL?

Answer»

Network calls are one of the key areas that will have a significant impact on the app's performance. To improve the app's performance, it should be fine-tuned to the highest level of accuracy.

  • If two different components are attempting to make HTTP calls to the same URL, it is preferable to make a single call and transmit data to both components than to make two separate HTTP calls. The requested action is completed in a MATTER of seconds.
  • The best method to do this is to use a root component. A shared root component should be used by all components making HTTP calls. This KEEPS note of URLS that were requested a few seconds ago, and if they are requested again, it can add a SMALL delay before SENDING the result to both components.


Discussion

No Comment Found