Do wp-cron scheduled tasks run asynchronously?

I have a task scheduled to run daily using wp-cron. The task takes over a minute to run (between downloading and parsing a very large file with cURL). According to the WP documentation,

“The action will trigger when someone visits your WordPress site, if the scheduled time has passed.”

Read More

Could this “someone” have to wait the full minute for my script to run while trying to access my site, or are wp-cron tasks asynchronous?

Related posts

Leave a Reply

1 comment

  1. No, the WP-Cron tasks run asynchronously from the viewing user. They should not see any delay.

    Although if your task takes more than a minute, it may never finish since most hosts are setup to kill PHP processes after 30 seconds.