1

I have created a Javascript based REST API page (private chrome extension) which integrates with the Oracle tool and fetches response. It works fine if the response is received within around 3-5 mins however, if it takes additional time it gives ERR_EMPTY_RESPONSE error.

I have tried xhr.timeout but still it gives the same ERR_EMPTY_RESPONSE error. How can we ask the Javascript to wait for more time?

Thanks..

1 Answers1

0

If you are making ajax call to server and want to increase waiting time of response then you need to set "timeout" interval at server side.

In nodejs I am giving the way that you can apply at server side to increase timeout period.

in app.js file(express framework)

write down following code

 app.use(function(req, res, next) {
 //Set time out for request to 24hour
 req.connection.setTimeout(24 * 60 * 60 * 1000);
 next();
 });

You can also refer this

HTTP keep-alive timeout

Proper use of KeepAlive in Apache Htaccess

you need to do this at server side

  • I cant edit the timeout at server side, what can be done at the client side.. Also, the header response I get from server is "keep-alive: timeout=5, max=100". Does it mean it keeps the response alive till 5 mins? I am using simple xmlhttprequest not using any javascript library.. – Abhijeet Panchgam Aug 22 '17 at 12:08
  • thanks for the update so I infer that client cannot control the timeout. Also, the issue which I am facing is related to timeout? or its some other? since the error response is not helpful to understand whats the issue – Abhijeet Panchgam Aug 22 '17 at 15:06