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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.