I'm developing web application (javascript + php) and I have architectual issue. I have to send 4 requests to server. First will gather basic information (effectivity is OK), then after receiving data from server, I have to do 3 one-by-one requests to different services on the same server (results of first response are query parameters for second request and so on..) My question is, what will be better?
- I send 1 request to another server and then this server is communicating with target server (both are in LAN network) and after all process finished first server response to client with effect
- Send all requests directly from client to target server
below is quick-schema of the situation.