Problem:
I am doubting that something in my network system is slow which is why responses from NodeJS server arrives late. I've noticed that the server is ready with the response fairly fast however, it takes time to reach the web browser.
Question:
What are the ways I can confirm whether this is infact happening or not? Basically to capture the time when the response left from my NodeJS server and then from the physical server and then compare it with the time that it arrived on the client web browser. How can I do this?
What I tried:
I tried putting a console.log after ctx.body to identify the point of time when the response left the server. But is this the correct point or can I go further down? I am a little unsure. Please advise.
FYI, I am using Koa.js.
Try Koa.js in debug mode and add a logger middleware to identify server side issues.
Use the network inspector in Chrome or any equivalent in other browsers to identify client side issues.
If none of the above helps, you can try debugging on the network level with
tcpdumpand Wireshark. This helps identifying protocol and connection issues.