I tried to use buffer flush to deliver output to user's browsers and continue with another time-consuming task. But flush() seems no working as expected.
I have set those values in my nginx:
gzip off;
proxy_buffering off;
fastcgi_buffer_size 1k;
fastcgi_max_temp_file_size 0;
fastcgi_buffers 128 1k;
fastcgi_busy_buffers_size 1k;
centos7.6, php7.2, laravel5.7
ignore_user_abort(true);
ob_start();
echo view('dataChart', $this->calc())->render();
ob_end_flush();
ob_flush();
flush();
sleep(15); //<- here's the problem, this 15s is supposed to have no effect. Page is expected to show immediately.
// Here's some heavy task
I want to know why this sleep(15) still has effect on page loading.
The response is still delyed for 15s.