Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-1101

Send "Connection: close" header after page output sending

    XMLWordPrintable

    Details

    • Type: Bug Report
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.0.0
    • Fix Version/s: 5.2.0
    • Component/s: Scheduled Tasks
    • Labels:
      None

      Description

      Administrator can set scheduled tasks to be executed:

      • in cron;
      • after page load.

      In later case long running scheduled task delays actual page content from being sent to user, who requested a page.

      To solve this we need to place following code after page content has been sent to user (but before scheduled task execution is started):

      ignore_user_abort(true);

      while ( ob_get_level() )

      { ob_end_clean(); }

      header('Connection: close');
      // header('Content-Length: 0'); // only uncomment when such header isn't sent already
      flush();

      This code will do following:
      1. web browser "Loading ..." indicator should show 100%
      2. connection to webserver will be terminated
      3. reset of the script will continue to execute on the server

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Alex
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: