Title: [Plugin: WP Super Cache] super cache and php speedy
Last modified: August 19, 2016

---

# [Plugin: WP Super Cache] super cache and php speedy

 *  [Ovidiu](https://wordpress.org/support/users/ovidiu/)
 * (@ovidiu)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/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. [http://aciddrop.com/2008/03/22/php-speedy-wordpress-plugin-version-04/](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/](http://wordpress.org/extend/plugins/wp-super-cache/)

Viewing 14 replies - 1 through 14 (of 14 total)

 *  [Rok](https://wordpress.org/support/users/rok/)
 * (@rok)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-super-cache-and-php-speedy/#post-805658)
 * 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](http://www.ditii.com/2008/05/28/ajax-libraries-api-speed-up-your-ajax-apps-with-google-cdn/).
 * For sitewide, use Super Cache Plugin.
 *  Thread Starter [Ovidiu](https://wordpress.org/support/users/ovidiu/)
 * (@ovidiu)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-super-cache-and-php-speedy/#post-805666)
 * 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
 *  [blogsdna](https://wordpress.org/support/users/blogsdna/)
 * (@blogsdna)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-super-cache-and-php-speedy/#post-805751)
 * hmm i am looking for this thanks for sharing.
 *  [johncoswell](https://wordpress.org/support/users/johncoswell/)
 * (@johncoswell)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-super-cache-and-php-speedy/#post-805752)
 * 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; }
       }
       ```
   
 *  [Kaspars](https://wordpress.org/support/users/kasparsd/)
 * (@kasparsd)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-super-cache-and-php-speedy/#post-805754)
 * 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.
 *  [ulfben](https://wordpress.org/support/users/ulfben/)
 * (@ulfben)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-super-cache-and-php-speedy/#post-805757)
 * johncoswell – I cant get your fix to work. Could you perhaps post the entire 
   source over at [http://pastebin.com](http://pastebin.com) for the rest of us?
   Thanks!
 *  [johncoswell](https://wordpress.org/support/users/johncoswell/)
 * (@johncoswell)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-super-cache-and-php-speedy/#post-805758)
 * [@ulfben](https://wordpress.org/support/users/ulfben/), [http://pastebin.com/mde7a944](http://pastebin.com/mde7a944)—
   Lines 455-460
 *  [ulfben](https://wordpress.org/support/users/ulfben/)
 * (@ulfben)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-super-cache-and-php-speedy/#post-805759)
 * Thanks. Unfortunately the fix doesn’t seem to help me – the modified WP Super
   Cache still doesn’t cache anything when running PHP Speedy.
 *  [johncoswell](https://wordpress.org/support/users/johncoswell/)
 * (@johncoswell)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-super-cache-and-php-speedy/#post-805760)
 * 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.
 *  [ulfben](https://wordpress.org/support/users/ulfben/)
 * (@ulfben)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-super-cache-and-php-speedy/#post-805762)
 * 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/](http://aciddrop.com/2008/12/15/php-speedy-wp-051-recommended-upgrade/)
 * Same results though. No caching whatsoever while speedy is running.
 *  [ulfben](https://wordpress.org/support/users/ulfben/)
 * (@ulfben)
 * [17 years, 5 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-super-cache-and-php-speedy/#post-805765)
 * *bump*
 * Any updates on this?
 *  Thread Starter [Ovidiu](https://wordpress.org/support/users/ovidiu/)
 * (@ovidiu)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-super-cache-and-php-speedy/#post-805768)
 * unfortunately it seems neither one of the two plugin authors is taking note of
   this issues 🙁
 *  [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-super-cache-and-php-speedy/#post-805769)
 * Ovidiu – I don’t use php-speedy and don’t have time to debug it. Sorry.
 *  Thread Starter [Ovidiu](https://wordpress.org/support/users/ovidiu/)
 * (@ovidiu)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-super-cache-and-php-speedy/#post-805770)
 * 🙂 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.

 * 14 replies
 * 7 participants
 * Last reply from: [Ovidiu](https://wordpress.org/support/users/ovidiu/)
 * Last activity: [17 years, 4 months ago](https://wordpress.org/support/topic/plugin-wp-super-cache-super-cache-and-php-speedy/#post-805770)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
