I have a very large file that takes about 5 minutes to download. Its strictly an administrator script, however, I am currently creating a user interface for interacting with the administrator. I want this script to run in the user interface via AJAX. Currently, the PHP script has:
@apache_setenv('no-gzip', 1); @ini_set('zlib.output_compression', 0); @ini_set('implicit_flush', 1); for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); } ob_implicit_flush(1);
Thus, it is gradually displayed through the browser.
However, my AJAX call (using jQuery) looks like this:
$.ajax({ url: "theURL", success: function(data){ $(".content").html(data); } });
And it is displayed only after the script is finished. How to get AJAX to use progressive output?
source share