Jump to content

How do you keep an AJAX connection live?


pentan

Recommended Posts

I'm using AJAX to feed data to a PHP program and that program has to do a fair bit of processing if the data stream is large.  The connection seems to be timing out if I send large chuncks.  How can I force the connection to remain open until the PHP program finishes executing the process?  The process can take as long as two minutes.

Thanks,
Michael
Link to comment
https://forums.phpfreaks.com/topic/23503-how-do-you-keep-an-ajax-connection-live/
Share on other sites

I suspect this is more of a php time out issue....

something taking that long is NOT good for clients to stay on your site.

you could always fork your scripts

[url=http://www.phpfreaks.com/tutorials/71/0.php]http://www.phpfreaks.com/tutorials/71/0.php[/url]
I'd agree that this is a PHP timeout.  You could try setting the timeout in the php.ini file if you have access to it or you could set it through code using set_ini().

Alternatively, you could split the work up and send it to the server in chunks.
Yes, you probably need to adjust php's time out limit.

But, if your asking: how do I halt the browser untill the process is complete, use a [u]synchronous[/u] request. Not recommended BTW.

But what in heavens sake are you doing that takes up to two minutes? That's madness.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.