Jump to content

Run multiple 'file_get_contents' at a time?


joecooper

Recommended Posts

My website involves loading several other pages at a time to produce results from all of them. The problem I had was loading times with some websites taking upto 10 seconds, where as others would take less than 1 second.

 

I ended up setting the timeout feature in the PHP.ini file to 1 second, which is fine not to include results from slow loading pages.

 

But I would like to be able to load all 10 web pages using "file_get_contents" simultaniously since the connection on my server is a good 100Mb. 

 

Is this possible?

 

Thanks

You could run the script to get the data in the background and save it to your own database, then select the data out of that when you need it.

 

As long as you're allowed to be doing what you're doing.

 

This is actually what I thought about doing, just that when someone makes a new search, there wont be any results the first time untill my script indexes the results.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.