Single request to specific API stalled for long

760 Views Asked by At

I've built up an API application with ASP.NET Core 2.2.

Everything has been fine. Except one PATCH API, which takes an ID and a list, to replace the list of corresponding item.

This API works fine with POSTMAN too. Simply and fast, works just as expected.

However, to run on browsers, it stalls 1 minute to send that request.

I've tried to make it simple by rewriting the App within only one jQuery function, to check if the problem is on my frontend app; however it still stalls for 1 minute.

I've looked up stalled, people say that it can be a Chrome policy to load maximum 6 requests at the same time; however it's not my case. There's only such request at that time, and every other API works fine except this one.

Also, I've tried with other browsers: Firefox and Edge, but it's still the same.

According to the article Chrome provides:

  • Queueing. The browser queues requests when:
    • There are higher priority requests.
    • There are already six TCP connections open for this origin, which is the limit. Applies to HTTP/1.0 and > HTTP/1.1 only.
    • The browser is briefly allocating space in the disk cache
  • Stalled. The request could be stalled for any of the reasons described in Queueing.

It seems that getting "stalled" for long, means that the request wasn't event sent. Does it mean that I can just exclude the possibility to fix backend API?

And also, since that there's no other request at the same time, does it mean that it most likely goes to the reason that "The browser is briefly allocating space in the disk cache", or is there any other reason?

And I also wander why only this API gets this issue. Is there anything special with the method "PATCH"?

1

There are 1 best solutions below

0
On

At first use stopwatch and evaluate response time of your code in browser and postman and see how take long time in each. If both is same, don't touch your code because your problem isn't from your method. If you can, test it with 'post http attribute' till know your problem is because of it or not. However I guess reason of it is your system. Of course it's possible ypur problem resolve with changing pipeline (startup.cs) . There are also problems like CORS that occurred only in browsers and not postman.