ajax.post 504,javascript - 504 GATEWAY_TIMEOUT in ajax call - Stack Overflow

The recommendation is to make more short calls to check status / retrieve data.

Here is the alternative if the above is not possible:

Notice: This solution is not recommended for production use or high traffic scenarios, make sure this action is performed on an isolated server.

If using Apache Web Server 2.4, the TimeOut directive is by default set to 60 seconds.

For more details see this article.

The web server will only keep the connection open for 60 seconds regardless the max_execution_time

While the max_execution_time in php.ini sets the execution time of php, the Apache TimeOut directive sets the maximum connection time.

Example:

if php max_execution_time is 120 sec, but TimeOut is 30 sec - you will get a 504 error

if php max_execution_time is 120 sec, but TimeOut is 300 sec - your script will execute for max 120 seconds, but your connection can stay alive for 300 seconds

If you didn't set any response code from php, PHP returns 200 if everything is OK, 500 if error occured.

When you get an unexpected HTTP Response code it's good to keep an eye on the web server too.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值