How To Enable Gzip With WP-Cache2

I’ve made one last tweak to my site to improve performance that I’d like to highlight to other WordPress users who use the WP-Cache2 plugin. WP-Cache2 unfortunately doesn’t work with gzip compression, which means that some of your pages might actually load slower than if you just used gzip.

Mark J as usual has provided a fix for WP-cache2 to make it it work with gzip compression, which makes WP-cache2 do the gzipping, not WordPress.

To turn on gzip with WP-Cache2 (do not turn gzip on in WordPress – let WP-Cache2 do the work, otherwise WP-Cache2 will disable itself) put the following line:

if ( extension_loaded('zlib') ) ob_start('ob_gzhandler');

above this line in wp-cache-phase1.php which is found in the WP-cache plugin folder:

foreach ($meta-»headers as $header) {

, , , , , ,

6 Responses to How To Enable Gzip With WP-Cache2

  1. Ajay January 3, 2007 at 3:38 am #

    Do you have it installed out here?

  2. Ajay January 3, 2007 at 3:40 am #

    Do you have it installed out here like this?

  3. taragana January 5, 2007 at 2:32 pm #

    It is better, cpu wise, to enable it from Apache.

  4. Everton January 5, 2007 at 2:39 pm #

    I always want to look after my CPU – will do now. thanks.

  5. Everton January 6, 2007 at 2:59 pm #

    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 :-( .

Leave a Reply