Merlin wrote:

Hi there,

I am reading a remote plain text file from another server via the file command:

$str = file ("http:/xxxxx");
This is a feed so there is no other way then reading it remote.

Now this reading takes up between 0.5 and 1.0 s which is far to slow. The whole other process on the site takes only 0.1 s and I would like to keep it inside this area of 0.1 - 0.2 s

Is there a faster way to read a remote txt file than with file() ?

If not, is there a way in php to process this in the background and continue to display the page without the results of the file?

not sure on a "faster" way, but you can have PHP handle this on the backend without disrupting the normal page load time...
Enter AJAX...
Set a side a place on your page for the results, and on page load issue an AJAX request to a backend process to get your contents from the file, and when it is done, your page can display at that point in time. Fairly common usage for AJAX, so there should be some good tutorials out there which google will help you find.

-brad

Thank you in advance,

Merlin


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to