joecooper Posted March 26, 2013 Share Posted March 26, 2013 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 Quote Link to comment Share on other sites More sharing options...
Jessica Posted March 26, 2013 Share Posted March 26, 2013 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. Quote Link to comment Share on other sites More sharing options...
requinix Posted March 26, 2013 Share Posted March 26, 2013 cURL can do multiple connections at once. See curl_multi_init for an example. Quote Link to comment Share on other sites More sharing options...
trq Posted March 26, 2013 Share Posted March 26, 2013 You might also look into reactphp (http://reactphp.org). An asynchronous non-blocking framework for php. Quote Link to comment Share on other sites More sharing options...
joecooper Posted March 31, 2013 Author Share Posted March 31, 2013 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.