1

There is a similar question around on SO but this problem is somewhat different and the answer on the other question is not the cause of my problem.

I'm tracking upload progress using APC with a little script (which is called every second using ajax) like this:

<?php
if(isset($_GET['progress_key'])){
    $status = apc_fetch('upload_' . $_GET['progress_key']);
    if($status['current'] != ''){
        echo '{"current":' . $status['current'] . ', "total":' . $status['total'] . '}';
    }else{
        echo '{"current":0, "total":100}';
    }
}else{
    echo "{}";
}
?>

Everything works fine except that APC reports upload progress until the upload is just about completed (I've tried with files of various sizes, it gets stuck at about 95 percent or so, file size seems irrelevant). Then $status['current'] keeps reporting the same value until the upload script is done processing the uploaded file. The uploaded file is a pdf, from which a preview thumbnail is generated, which takes about 10 seconds, during this time APC keeps reporting the same value.

Does anyone have any idea what might cause this, and more importantly, how to fix this?

Update By the way, I have set apc.rfc1867_freq=0

4

0 回答 0