1

I've been searching for an answer to this question for a while now. I have a request that has the potential to take longer than 1 minute but it keeps timing out after 1 minute resulting in a 504 response. Since this is a .net core application, there is no web.config file to change the timeout property(at least until the application is published), therefore I have not been able to find a solution to this problem. Any help would be very appreciated

I am running on .net core 2.2 by the way.

UPDATE: It seems that I have now uncovered the reason behind the 504. It is the load-balancer that responds with a 504 if the server connection is idle for 60 seconds. The question has now become how do I keep the connection from going idle for 60 seconds during this call.

2
  • are you using IIS? Commented Oct 20, 2019 at 16:02
  • Maybe this would help medium.com/aspnetcore/… Commented Oct 20, 2019 at 16:56

1 Answer 1

2

if you are running your application behind IIS you can add a web.config file to your project and then set the request timeout via the web.config file.

If you add your own web.config file, when you publish your application your file will be used and merged with some settings generated by asp.net core.

So add a web.config file to your project and modify the request timeout from there.

Out of curiosity, why you have a request which lasts as long as one minute ? Are you sure about your application design ? One minute is a very long time, you should try to reconsider your design. Trying to increase the request timeout on the web server side seems to be a workaround to me.

Sign up to request clarification or add additional context in comments.

1 Comment

You are right about the design. It has a UI component and I am terrible at JS so what I am doing is handling the load of a large request server side, when I now believe I should batch the calls client side and send multiple calls. The reason I did not was because This is a single function application and would have taken me along time to set it up that way, but maybe I wont have an option. Thanks for the help :) .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.