Re: Quick file_get_contents() questions...your opinion needed

From: Date: Mon, 11 Oct 2004 15:17:46 +0000
Subject: Re: Quick file_get_contents() questions...your opinion needed
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-199180@lists.php.net to get a copy of this message
On Mon, 11 Oct 2004 07:24:03 -0700 (PDT), Mag <genphp@yahoo.com> wrote: > $url=file_get_contents("http://www.yahoo.com/"); > > The thing is, it takes quite some time (2-5 secs) > before the contents are in my program (I am using my > local webserver on my desktop for testing...not a > webserver) > > My questions are for you more experienced guys... > is there anyway to 'quicken' the process or is this > normal? > do you recommend anything other than > file_get_contents() ? > and lastly, is this a resource intensive hog? The 2-5 seconds is most likely a DNS lookup. You can speed it up by using a local caching DNS server or the IP address, or possibly a DNS server under less load. file_get_contents() is fairly new and and therefore not very backwards compatible with older PHP installs as a result. It's handy and all, but I found our production servers were running a PHP too old to use it one day last week when I tried. -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/

« previous php.general (#199180) next »