Support » Plugins » [Plugin: WP Super Cache] super cache and php speedy

  • just noticed there is a way to get php speedy to work with suepr cache mentioned on the authors page.

    Known issue with wp-cache/WP Super Cache

    I managed to do some proper testing with PHP Speedy WP and wp-cache and WP Super Cache. With all the buffer functions going on, the plugins get confused. I found that this could be fixed by amending the wp-cache-phase2.php file in the wp-cache/wp-super-cache directory. Just find the line that says: if ($new_cache) { and add this before it:

    global $cache_filename;
    $mtime = @filemtime($cache_path . $cache_filename);
    if( !((!$file_expired && $mtime) || ($mtime && $file_expired && (time() - $mtime) <5)) ) {
    $new_cache = true;

    does this make sense and if yes can it be incorporated into the newest wp super cahce version?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Sorry! I cann’t see any difference in terms of speed with PHP Speedy plugin. For your JS, you can speed up with Google CDN.

    For sitewide, use Super Cache Plugin.

    well, speedy just took my 5-8 js scripts being loaded by different plugins, compressed them into one and gzipped it so its smaller and only one file now. thx for the other tipps

    hmm i am looking for this thanks for sharing.

    I believe I have a solution to this problem. PHP Speedy’s output buffering gets stacked below WP Super Cache’s, and the way that WP Super Cache handles working with its own output buffer doesn’t take this into account. The buffers below WP Super Cache’s need to be resolved before WP Super Cache can continue with its page processing. I’ve come up with the following code which seems to allow PHP Speedy and WP Super Cache to play nicely together. This replaces the standalone @ob_end_flush() in wp-cache-phase2.php:

    //back up through any output buffers until we get to us
    $output_buffer_handlers = ob_list_handlers();
    while (count($output_buffer_handlers) > 0) {
      if (array_pop($output_buffer_handlers) == "wp_cache_ob_callback") { break; }

    johncoswell, your fix also works with the latest version of PHP Speedy (0.5) which is compatible with WP 2.7. Thanks for the tip!

    If this addition doesn’t break anything for the most PHP environments, maybe it is worth including it in one of the future releases of Super Cache.

    johncoswell – I cant get your fix to work. Could you perhaps post the entire source over at for the rest of us? Thanks!

    Thanks. Unfortunately the fix doesn’t seem to help me – the modified WP Super Cache still doesn’t cache anything when running PHP Speedy.

    OK, can you do a little diagnostic for me? Right after:

    $output_buffer_handlers = ob_list_handlers();

    can you add:

    error_log("buffers: " . implode(", ", $output_buffer_handlers));

    And then post the result from your error log? I want to see what the status of the buffers on your machine looks like when you hit that point in the code.

    Well, actually – I never hit that point. The caching never happens. (while running PHP Speedy 0.5). With PHP Speedy off, $output_buffer_handlers is empty.

    Just noticed 0.5.1 was released:

    Same results though. No caching whatsoever while speedy is running.


    Any updates on this?

    unfortunately it seems neither one of the two plugin authors is taking note of this issues 🙁

    Ovidiu – I don’t use php-speedy and don’t have time to debug it. Sorry.

    🙂 k, thx donncha now at least I know you read this 😉

    I am impatiently waiting for you to finish wpmu 2.7 so please don’t waste your time on this minor issue 🙂

    have a nice day

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘[Plugin: WP Super Cache] super cache and php speedy’ is closed to new replies.