Jump to content


How do you keep an AJAX connection live?

  • Please log in to reply
3 replies to this topic

#1 pentan

  • Members
  • PipPip
  • Member
  • 19 posts

Posted 10 October 2006 - 05:33 AM

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.


Michael Shaffer
"You know you have it, but can you _show_ you have it?"

#2 ToonMariner

  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 10 October 2006 - 10:55 AM

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

follow me on twitter @PHPsycho

#3 ober

  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 10 October 2006 - 12:57 PM

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.

Info: PHP Manual

#4 448191

  • Staff Alumni
  • Advanced Member
  • 3,545 posts
  • LocationNetherlands

Posted 11 October 2006 - 04:54 PM

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 synchronous request. Not recommended BTW.

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

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users