0

I have a C# ASP.NET MVC application in which I am submitting one HTML post request form from which I get an error

504 Gateway Time-out

In the action method I have to do too many things, So it will taking around the 2 minutes.

In my application I done the following changes:

Action method:

System.Web.HttpContext.Current.Server.ScriptTimeout = 120;

web.config:

<httpRuntime maxRequestLength="1048576" requestValidationMode="4.0" executionTimeout="110" targetFramework="4.6.1" />

But after doing the above changes, I am still getting the 504 error after 1 minute.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Kalpesh Rajai
  • 2,040
  • 27
  • 39
  • I think for long tasks it is better to use queue and process them with background worker. And on your HTTP method return message, that task was added to the queue. If you want to notify front-end about finished tasks you can use SignalR for this – Anton Feb 17 '20 at 12:50
  • Sorry, But I can not implement like this.. As in action method I am collecting the data and creating the file and return that file from the action method (Using DevExpress). – Kalpesh Rajai Feb 17 '20 at 13:02
  • This is likely because the request is going through a proxy and the proxy times-out the request. See https://stackoverflow.com/questions/32782922/what-do-multiple-arrow-functions-mean-in-javascript for more info. – phuzi Feb 17 '20 at 15:06

0 Answers0