D
D
Dimash Kenzhegaliev2022-03-01 23:39:27
Node.js
Dimash Kenzhegaliev, 2022-03-01 23:39:27

Why is my http request very slow?

I have a completely normal http request code on axios this url is just a web page, that is, html code, I understand that html can weigh a lot, but the request takes too long, from about 1 to 3 minutes and 1 time out of 5 returns html code to me , and in other cases, the error is -60 ETIMEDOUT , I checked, sent the same request from the online http requests site - and there it works fine in about a second, I thought that maybe the request from my ip is long and I sent the same request from the insomnia application and there is the same result - it works fine, that is, it is my code that the request takes a very long time. Has anyone come across this?
const response = await axios.get(url)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nochkin, 2022-03-02
@nochkin

I would check that this is the code, and not the network, for example.
You can make a request via "curl" and see what happens. If again the brakes, then you need to check what's wrong. For example, make a request through Chrome and see what takes time. Maybe DNS slows down or reverse lookup is enabled on the other side, which slows down.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question