What is the fastest way to execute many PHP pages. I will not need to see them (i.e. scrape or retain any information from any html that is output), but they need to load. The PHP code within each page needs to be executed.
I first started out doing foreach (...){echo <iframe src=.... (very ugly and took very long and very bad idea)
Now I’m thinking to set a jquery timer to keep loading ajax requests and go through an array.
Is there a better way to go about this?
Multi-threading is going to let you call URL’s as fast as possible as you can have multiple loading at the exact same time. PHP doesn’t really have good support for multi-threading but we can have it do multi-processing. This will allow you to kick off a URL request and immediately kick off more without waiting for any of the pages to load.
The following code is an example of how to accomplish this using wget. This will be fast but does have the downside of not letting you know about a success or failure.
This could be taken a step further to call your own php script instead of wget. In which case your program can log the urls that failed to load.
So a complete example could be something like the following:
run.php
loadPage.php