RE: [PHP] Slow in retriveing webpage
| From: | Matt Friedman | Date: | Sat, 04 May 2002 15:04:04 +0000 |
| Subject: | RE: [PHP] Slow in retriveing webpage | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-96053@lists.php.net to get a copy of this message | ||
Grab the file using a script that is run by Cron, assuming your are on a
Linux type system. Grab it every 5 minutes or something. Store/cache it
on your web server. Then when you need the file in your other script,
grab it from the place where you've cached it. You're script can then
get the content almost instantly!
Matt Friedman
-----Original Message-----
From: Joseph Then [mailto:nkthen@singnet.com.sg]
Sent: Saturday May 4, 2002 10:03 AM
To: php-general@lists.php.net
Subject: [PHP] Slow in retriveing webpage
Hi!
I want to grab a webpage and I use the file() function to grab it.
The URL in the file() function works OK when I typed it in my address
bar.
The speed is OK.
$fcontents = file
("http://www.website.com/cgi-bin/cgifunction/webpage.cgi");
However, when I use the above code and tried to run the PHP file, I have
to
wait for 10 seconds before I get any results.
I tried to isolate the problem and realised that the slowing down
portion is
the above line. I tried fopen() and the results is still the same.
I need to know if it is possible to speed up the above process.
If possible, please email me at nkthen@singnet.com.sg
Thank you for any help rendered.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php