由于缓存,刷新nginx无法正常工作

I'm trying to create a progress bar it get some data then do some script and during this process it shows progress loading.

I set before header config with :

    // set php execution time to unlimited
    set_time_limit(0);

    // disable cache on server
    @ini_set('zlib.output_compression', 0);
    @ini_set('output_buffering', 0);
    @ini_set('implicit_flush', 1);

    // for Nginx no buffering
    header('X-Accel-Buffering: no');
    header('Content-Encoding: none');

    // set content length to calculate progress percentage
    header("Content-length: 101");

    @ob_end_clean();

then there is a loop:

   $send = '';
    for ($i = 0; $i < $count; $i++) {
        $send .= ' ';
    }
    echo $send;
    flush();
    sleep(1);

it sends charters to progress and then flush!

please help me by this!