At 15:48 08.11.2002, Serge Paquin spoke out and said:
--------------------[snip]--------------------
>I get no output at all.
>
>All DoCache does is write $buffer to a file then return $buffer since I use
>this for some other serverside caching to save on database hits.
>
>I have other areas that I call ob_start("ob_gzhandler") and that works fine
>but when I call in via DoCache it breaks.
>
>I much prefer your idea of mod_deflate.  I will look into that since I
>believe that belongs in apache rather than a PHP program also.
>
>I am still curious why it doesn't work though.
>
>Here is my "True" DoCache function:
>
>function docache ($buffer) {
>        $fp=fopen(cachefilename(), "w");
>        if($fp)
>                fputs($fp,$buffer);
>
>        return ob_gzhandler($buffer);
>}
>
>cachefilename() simply returns an MD5 of the requested URI.
>
>This will return a blank webpage in IE and Mozilla.  When I take out
>ob_gzhandler it then works fine.
--------------------[snip]-------------------- 

It seems to me your ob_gzhandler is broken... anyway, since PHP 4.0.3 the
output callback function has a second parameter called "mode", even if you
don't do anythiong with it you should pass it on:

function docache ($buffer, $mode) {
       $fp=fopen(cachefilename(), "w");
       if($fp)
               fputs($fp,$buffer);

       return ob_gzhandler($buffer, $mode);
}

But I doubt this would change anything here... ob_gzhandler _should_ return
some value. You have some output in the file do you?



-- 
   >O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
    ^ http://www.vogelsinger.at/

Reply via email to