I was wondering if there was a way to return a page to a user before a specific process is complete in PHP. I've done this in C++ before using asynchrony on a client-only application, but this is something I've never tried. Consider the following hypothetical process:
- The user logs onto a website and presses a button to backup a large file to another server. The website is being served by PHP
- The request to backup the server goes to PHP and begins executing. The process may take a long time and needs to start immediately, but we don't want the user to sit there waiting for a response from the server. Think HTTP 202.
I was wondering more specifically if there's a way to do this in the function that is called by the request without needing to put a task in a specific cache of sorts to be run by something like a cron.