By using this:
$size = ob_get_length();
header("Content-Length: $size");
header('Connection: close');
ob_end_flush();
ob_flush();
flush();
Along ignore_user_abort(true);
I get to receive with an ajax call a complete status and let the file handle server side without the user having to wait for a response for the contents of the file to be parsed.
I'd like to achieve the same but with a header("Location: target");
instead of header('Connection: close');
- so it looks as everything is finished but the file continues to parse after triggering header("Location: target");
What would be the right approach into letting the file to continue working but redirect the user with PHP.
By the way before five down votes in a row, the question is not duplicate of PHP Redirect User and Continue Process Script although the title seems to resemble this question.