At 07:45 08.11.2002, Serge Paquin said: --------------------[snip]-------------------- >Hello, > > Is their anyway to use ob_gzhandler along with another callback? I've >tried the following which does not work: > >function DoCache($buffer) { > /* Do a bunch of stuff */ > return ob_gzhandler($buffer); >} > >ob_start("DoCache");
What do you mean by "does not work"? Does it output "nothing", or can't you see any compressed data? 1) output is empty Must be an error in your DoCache() function - check the buffer you're passing to ob_gzhandler() by writing it to a file (you can't echo it here...) 2) you don't see compressed output 2.a) That's how it is designed. ob_gzhandler checks the request headers to see if the browser supports any of the compressed formats (gzip, deflate), and if it doesn't find it then it simply does nothing. 2.b) PHP needs to be compiled using --with-zlib to provide ob_gzhandler support. You don't get any error if you don't have zlib configured. Check phpinfo() to see if zlib support is available. Personal hint: If you're using the url_rewriter.tags and have session cookies disabled, ob_gzhandler will break this. The reason is that PHP parses the _very_final_ output to mangle the session identifier to any (local) url; in case this _very_final_ output is compressed ir can't find any link and can't merge the session identifier. I personally believe it's better to have compression be done at the web server (refer to http://httpd.apache.org/docs-2.0/mod/mod_deflate.html). It's more general then, after all... -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php