Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First I suggest you to reorder your tasks:</p> <ol> <li>User uploads an image</li> <li><p>Upload confirmation is sent to user.</p></li> <li><p>Image is processed</p></li> <li>Other time intensive functions are called</li> </ol> <p>Then you have following options, how to deffer parts 3&amp;4:</p> <p>Option 1: Send confirmation to user on step 2, use <code>ignore_user_abort()</code> and continue with handling image (non optimal, as user will still see "page loading" message.</p> <p>Option 2: IBP-style. Do steps 1-2, then add processing job to some sort of database. At random time show image to the users.. Image is actually link to the php script that do <code>ignore_user_abort()</code> and process your queue of items.</p> <p>Option 3: Same as option 2, but don't show image. Instead, you will have to do request to own server with cURL, or similar. Idea is that you start request, and don't wait for it to end, just stop main script execution.</p> <p>Option 4: start a cron script that starts every 5-15 minutes and do needed tasks. It can also live on background 24h, and sleep for 20 seconds between checking for tasks. This option might be best in case you have relatively busy website. </p> <p>Option 5: try to do something like exec() or shell_exec() to ruin processing script on background, after you added task to the queue. </p> <p>Examples of how to do options 2 &amp; 3: <a href="https://stackoverflow.com/questions/124462/asynchronous-php-calls">Asynchronous PHP calls?</a> <a href="https://stackoverflow.com/questions/962915/how-do-i-make-an-asynchronous-get-request-in-php">How do I make an asynchronous GET request in PHP?</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload