WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP Super Cache] super cache and php speedy (15 posts)

  1. Ovidiu
    Member
    Posted 6 years ago #

    just noticed there is a way to get php speedy to work with suepr cache mentioned on the authors page. http://aciddrop.com/2008/03/22/php-speedy-wordpress-plugin-version-04/

    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?

    http://wordpress.org/extend/plugins/wp-super-cache/

  2. Rok
    Member
    Posted 5 years ago #

    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.

  3. Ovidiu
    Member
    Posted 5 years ago #

    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

  4. blogsdna
    Member
    Posted 5 years ago #

    hmm i am looking for this thanks for sharing.

  5. johncoswell
    Member
    Posted 5 years ago #

    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) {
      @ob_end_flush();
      if (array_pop($output_buffer_handlers) == "wp_cache_ob_callback") { break; }
    }
  6. Kaspars
    Member
    Posted 5 years ago #

    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.

  7. ulfben
    Member
    Posted 5 years ago #

    johncoswell - I cant get your fix to work. Could you perhaps post the entire source over at http://pastebin.com for the rest of us? Thanks!

  8. johncoswell
    Member
    Posted 5 years ago #

    @ulfben, http://pastebin.com/mde7a944 -- Lines 455-460

  9. ulfben
    Member
    Posted 5 years ago #

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

  10. johncoswell
    Member
    Posted 5 years ago #

    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.

  11. ulfben
    Member
    Posted 5 years ago #

    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: http://aciddrop.com/2008/12/15/php-speedy-wp-051-recommended-upgrade/

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

  12. ulfben
    Member
    Posted 5 years ago #

    *bump*

    Any updates on this?

  13. Ovidiu
    Member
    Posted 5 years ago #

    unfortunately it seems neither one of the two plugin authors is taking note of this issues :-(

  14. Donncha O Caoimh
    Member
    Posted 5 years ago #

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

  15. Ovidiu
    Member
    Posted 5 years ago #

    :-) 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

Topic Closed

This topic has been closed to new replies.

About this Topic