I have an application that is stalling each time it makes a http request to a server. It stalls until the response is received from the server. The problem is, the server takes a while to respond to this specific http request, and takes several seconds (10-30 seconds). This causes a big lag in the application. The response to the http request is always the same (basically a "OK"), and the request never fails... it just takes a long time for the server to process it.
I am trying to remove this lag, by possibly using a proxy server or MITM application that can intercept this http request and respond immediately with the "OK", while also forwarding this http request to the server.
Are there any tools I can use this to accomplish this? I see rewrite tools available in such stuff as Charles, but these basically rewrite the http request or response, not exactly what I'm trying to do.
Basically, the flow would be this:
- Proxy server receives http request.
- Proxy server immediately responds to the http request appropriately ("OK").
- Proxy server sends the http request to the main server (the server the application intends to communicate with).
- Proxy server receives the reply (10-30 seconds) later from the main server, and simply dumps it (as the application has already received it's reply).