I have complicated MySQL query that responses large amount of data, as a result the PHP page that shows this response got pending status (DevTools) as long as 2-3 minutes of running time, before the page fully loaded and I've been able to see the contents, meanwhile waiting its a blank page...
Is there an elegant way to maybe slice the result generation like each row will be echo'ed to the page before php script going to the next row (while loop). May be a jQuery asynchronous request or some other clever and elegant solution.
So finally I'll be able to start seeing the results as page loads, it may take the same 2-3 minutes of loading but each second (for example) I'll see one more row echoed to the page, instead of waiting 2-3 minutes in front of blank page.
P.S. I think it should work like some images lazy loading or like facebook scroll down that loads next results (but without the scroll)