Index: branches/5.2.x/core/kernel/managers/scheduled_task_manager.php =================================================================== diff -u -N -r15456 -r15457 --- branches/5.2.x/core/kernel/managers/scheduled_task_manager.php (.../scheduled_task_manager.php) (revision 15456) +++ branches/5.2.x/core/kernel/managers/scheduled_task_manager.php (.../scheduled_task_manager.php) (revision 15457) @@ -1,6 +1,6 @@ getAll(); $user_id = $this->Application->RecallVar('user_id'); Index: branches/5.2.x/core/kernel/application.php =================================================================== diff -u -N -r15456 -r15457 --- branches/5.2.x/core/kernel/application.php (.../application.php) (revision 15456) +++ branches/5.2.x/core/kernel/application.php (.../application.php) (revision 15457) @@ -1,6 +1,6 @@ setContentType(); + ob_start(); if ( $this->UseOutputCompression() ) { $compression_level = $this->ConfigValue('OutputCompressionLevel'); @@ -1213,10 +1214,23 @@ echo gzencode($this->HTML, $compression_level); } else { + // when gzip compression not used connection won't be closed early! echo $this->HTML; } + // send headers to tell the browser to close the connection + header('Content-Length: ' . ob_get_length()); + header('Connection: close'); + + // flush all output + ob_end_flush(); + ob_flush(); flush(); + + // close current session + if ( session_id() ) { + session_write_close(); + } } /**