I am reading the cron.php code in wp-include and spawn_cron() , it seems the one that actually performs the registered tasks.
The last two lines of the function:
$cron_url = site_url( 'wp-cron.php?doing_wp_cron=' . $doing_wp_cron ); wp_remote_post( $cron_url, array( 'timeout' => 0.01, 'blocking' => false, 'sslverify' => apply_filters( 'https_local_ssl_verify', true ) ) );
It simply opens wp-cron.php, passing the task as a request argument.
API description at the top of cron.php:
* Schedules a hook which will be executed once by the WordPress actions core at * a time which you specify. The action will fire off when someone visits your * WordPress site, if the schedule time has passed.`
My question is that they say that the visitor opens one of the pages of the site, and then the registered task is launched by the cron API. And if the task is difficult and takes several minutes, does the visitor get a page that is not fully loaded until the task is completed?
[Edit] To clarify what I'm asking, the question is, does the WP Cron API launch tasks after the page has finished loading?
source share