You are here: Re: Long delay with CURL « PHP SQL « IT news, forums, messages
Re: Long delay with CURL

Posted by NC on 02/25/06 02:34

Evil Bert wrote:
>
> I'm trying to write a PHP function that will go out to several sites
> to grab data using the CURL function. The results are then reformatted
> and displayed to the visitor.
>
> The problem is that I need to go out to 5 or more sites and each one
> takes approximately 10 to 30 seconds. So the problem I am faced with
> is, this is way too long (2+mins) forthe website visitor to wait. I'm
> not sure if PHP supports anytype of threads or any other way I could
> the task faster.

Are you sure you want this to be done for every visitor in real time?

A much faster approach would be:

1. Every hour, get the files in question, reformat them and store
the result for future use. Schedule this with cron and use the
command-line interpreter.

2. When the visitor requests the page, serve the data prepared
in step 1.

Cheers,
NC

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация