[3.0 RC1] ob_start('ob_gzhandler') No Longer Works in My Theme Header (4 posts)

  1. magblogapi
    Posted 6 years ago #

    I use output buffering with the GZIP handler to compress my output.

    I have always had it in the theme header/footer.

    In 3.0, it has stopped working (sends junk to the browser).

    That means that it is wrapped in ob_ calls.

    At first glance, I can't find these calls. I ended up hacking the main index.php file to add these (YUCK).

    Can anyone tell me where they added the ob_ calls?

  2. magblogapi
    Posted 6 years ago #

    Just FYI. I simply added the GZIP stuff to the .htaccess, which is OK for the site I'm working on, but is not a particularly portable solution, and can get whacked by upgrades easily. At least the core didn't get hacked.

    I'd love any feedback on workarounds.

  3. Steven Vachon
    Posted 5 years ago #

    I'm having a problem with this as well with my plugin. For some reason I never noticed it on my WordPress site, but now that I'm working on a clean 3.1 install, this error is presenting itself. Did you have any luck figuring this out?

  4. Steven Vachon
    Posted 5 years ago #

    I ended up figuring out what was wrong with my setup. I had my ob_start() within a "get_header" action hook callback, and my theme didn't make use of a header.php file

    As for your issue, it's clear to me now that it's different than mine. Nested output buffers are allowed, but if an outer buffer ends up working with a gzip, things could get messed. How and when are you initiating your output buffer? With the right hook, you could get it to start before anything in index.php

Topic Closed

This topic has been closed to new replies.

About this Topic