How to Optimize REST API calls

后端 未结 5 1475
感动是毒
感动是毒 2020-12-30 08:25

I am in process of building Mash up mobile application. I need to call my API Provider and integrate with Facebook , twitter etc. During this process, I have to make multip

5条回答
  •  囚心锁ツ
    2020-12-30 09:11

    If you need the results of the first API call in order to make the next API call, then there is nothing you can do client-side to avoid a sequential round-trip for each one. There would either need to be an existing API call that can be used to combine multiple calls into one or you would need to add such an API call to the server or you would need to use a proxy server that does that on your behalf.

    If you don't need the results of the first API call in order to make the next API call, but you just want to process the results in sequential order, then you can make all the API calls at once and structure your response code to process them in order (saving any results that arrive out of order for later processing).

提交回复
热议问题