php - Ajax jQuery returning successfully after 10 seconds when it shouldn't -
i've got jquery ajax call goes of server backend.php script , told sleep 13 seconds (or more) before responding simple test message. i'm seeing ajax success function triggering (with 200 response observed in firebug) after 10 seconds no actual response server. if set response delay less 10 seconds response message perfectly.
is you've seen before? there default php timeout thing going on?
ajaxcall = $.ajax({ type: "get", url: "backend.php", async: true, cache: false, datatype: 'json', timeout: 30000, /* timeout in ms. default 30000 (30 seconds) */ data: "timestamp=" + timestamp, success: function(data) { if (data !== null) { $('#texthistory').append(data.message); if (data.timestamp != 0) { timestamp = data.timestamp; } } settimeout( waitformsg, /* request next message */ 5000 /* ..after 5 seconds, default 5000*/ ); }, error: function(xmlhttprequest, textstatus, errorthrown) { $('#texthistory').append('<p>error:' + errorthrown + '</p>'); settimeout('waitformsg()',"15000"); /* milliseconds (15seconds) default 15000 */ } });
}
..and on server side i'm doing this:
<?php header('content-type: application/json'); sleep(13); // changing test it. work if less 10 $when = date("h:i:s",strtotime("now")); $response["message"] = "<p>small test $when</p>"; $response["timestamp"] = 123456789; echo json_encode($response); ?>
definitely timing out after 10 seconds
place call phpinfo()
on blank page , see timouts set to
look @ max_execution_time one
it'll need overriden in php.ini file or in php directly
Comments
Post a Comment