开发者

Ajax post, repsonse not received

开发者 https://www.devze.com 2023-03-09 04:20 出处:网络
Currently I am doing a jQuery post to fetch some data from the server. In standard circumstances a large JSON is returned.

Currently I am doing a jQuery post to fetch some data from the server. In standard circumstances a large JSON is returned.

The first time this call runs it requires a large amount of processing time, (I've seen up to 15 minutes. We do have plans to create worker processes to build these behind the scenes and relay progress to the client) after the processing has completed we store this in a cache and return the JSON to the user.

In both scenarios we return exactly the same JSON to the client, the only difference being, if the cache is built it is returned in a few milliseconds, if the cache is not built, it can take a long time for the client to receive the response.

When this is running on the server, if the requests takes a long time the client never receives the ajax response but the server does complete the process (access logs show 200 statusCode) and store the cache. For reference on my localhost the ajax response is always received, regardless of time (or so I have seen thus far).

In a nutshell, we make a ajax post, if it takes a long time, the post response is never received and ends up 开发者_如何转开发waiting indefinitely.

This sounds like it is either a PHP or server side setting, but I can't seem to find the issue.

Any ideas or help are much appreciated.


Sounds like you need to increase the timeout on the ajax request?

timeout is an option on the base jquery ajax method - http://api.jquery.com/jQuery.ajax/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号