Running WordPress on the Command Line – Turn off Delayed Output?

After some testing indeed, both WP Super Cache and W3 Total Cache do not release the buffer (or prevent the buffer from being released).

Turning off “output delay” is simple and depends on the caching plugin involved.

WP Super Cache:

wp_cache_disable();
ob_end_flush(); // or ob_end_clean();

This should be added after including wp-load.php, this stops any caching dead in its tracks and flushes the buffer.

W3 Total Cache:

ob_end_clean(); // or ob_end_flush();

Same as above, call after including wp-load.php, similarly to what you have there; should work with just flushing, W3 Total Cache does start buffer, however it does not appear to prevent its flushing per se. Judging by the way your output is still cached and flushing does not work, I’d say you have WP Super Cache, which is more aggressive.

Make sure that you don’t start a new buffer before including wp-load.php, otherwise you’ll have a buffer within a buffer (bufferception?), and will have to flush twice or more.

Leave a Comment