Created
August 13, 2015 14:34
-
-
Save ramsey/aa76c1656ca9fa6eeab7 to your computer and use it in GitHub Desktop.
Return a response to the client before processing anything
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Return our response as quickly as possible. | |
header('Connection: close'); | |
ob_start(); | |
header('HTTP/1.0 204 No Content'); | |
ob_end_flush(); | |
flush(); | |
// This immediately sends our response to the client; I hope you didn't have any other headers to set. | |
// Now, you can do all your other processing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment