The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2012, 08:22:04 AM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: Good article on fixing timeouts in your php scripts...  (Read 1003 times)
jsp123
Rookie
**
Offline Offline

Posts: 20


View Profile
« on: June 05, 2007, 10:59:19 AM »

http://www.unsoughtinput.com/index.php/2006/11/01/weird-errors-fix-timeout-issues-in-curl-php-and-apache/

I never knew about the flush() function in php, also I never set the timeouts for curl which is definitely going to be helpful for scraping overture or using proxies.  Smiley

Logged

No links in signatures please
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 9896



View Profile
« Reply #1 on: June 05, 2007, 11:08:55 AM »

Flush is powerful, and can be used to great GUI effect if what you "flush" is a little bit of javascript that updates a DIV on your page. For example:

<script>document.getElementById('status').innerHTML='Done with step 1';</script>

... everytime you hit a milestone in your code, you can send this on a long procedure. There is a little problem though in that some browsers will not start to render until a certain amount of answer comes back from the server - I've heard that 1024 bytes is a good marker... if you find that you are getting troubles with seeing your flushed data, then send 1K of comments (either HTML or js, I don't think it matters) and see if you get a different result.

@ timeouts - race conditions and timeouts are the frigging bane of my existence at times. Totally understand.

/p
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!