Compressing php output with wp-cache2 WordPress Plugin
Wp-Cache2 is a WordPress Plugin to cache WordPress generated pages. However it doesn't work with in-built gzip compression. Lets see how we can solve it.
Wp-Cache 2 significantly increases performance of WordPress enabled websites. Additionally it drastically reduces the processing load on the machine. It is intelligent to understand when to refresh the cache based on author / publisher activity.
This blog uses wp-cache 2.
It comes with some costs. It doesn't allow you to compress your output in gzip format, a facility provided by WordPress.
BTW: wp-cache-2 doesn't work on Windows based servers.
The solution is to use Apache mod_deflate module.
A simple configuration (add in httpd.conf) might be:
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
This assumes you have mod_deflate loaded. If not load it first:
LoadModule deflate_module modules/mod_deflate.so
Let me know your experience with this.
Filed under CMS Software, Headline News, How To, Linux, Pro Blogging, Tech Note, Web, WordPress |
|
RSS 2.0 |
Trackback this Article
|
Email this Article
You may also like to read |




































January 31st, 2006 at 6:00 am
It seems to me that the problem was that with WP’s gzip turned on, it was caching the zipped output. I edited wp-cache-phase1.php and put in the following:
if( extension_loaded('zlib') ) ob_start('ob_gzhandler');right above this line:
foreach ($meta-»headers as $header) {And it seems to work beautifully. That caches the plaintext, but gzips the text before delivering on cached hits. Might work for people you can’t mess with server configuration files.
October 22nd, 2006 at 8:14 am
[...] Compressing php output with wp-cache2 WordPress Plugin [...]
January 5th, 2007 at 9:34 am
When using mod_deflate do I get the benefits of mod_gzip, i.e. saved bandwidth?
January 5th, 2007 at 8:56 pm
Yes and it is faster too.
January 6th, 2007 at 8:55 am
mod_deflate is a module specific to the Apache 2.0 series, so I can’t install it as it’s not compatible with cpanel yet :-(.
I’ve had to turn WP-cache2 off temporarily anyway, because v2.20 isn’t refreshing when new comments or posts are bad