Bad Behavior + Wp-cache + Gzip Solution
So while installing some nice spam protection, I came across some interesting conflicts between.
1. Bad Behavior (The spam filter plugin)
2. WP-Cache (The Speed the site up plugin)
3. GZIP (The zip the page and server it to you faster feature built into Wordpress).
Basically wp-cache doesn’t work with gzip and bad behavior doesn’t work with wp-cache.. how to fix this?
1st: Go out and download the newest versions of both wp-cache 2 & Bad Behavior
2nd: Turn off gzip in the options.
3rd: Edit: wp-cache-phase1.php
Add This line:
if ( extension_loaded(‘zlib’) ) ob_start(‘ob_gzhandler’);
Before this:
foreach ($meta->headers as $header) {
header($header);
4th: Edit: /wp-content/advanced-cache.php
Add:
if ( extension_loaded(‘zlib’) ) ob_start(‘ob_gzhandler’);
Before this:
foreach ($meta->headers as $header) {
Now everything shouldu play together nice. Your site should BLAZE and be protected.
Enjoy :)
July 9th, 2006 at 12:19 am
Maybe I should add some graphics, this isn’t nearly as nice looking as I had hoped. ;)
August 25th, 2006 at 8:37 pm
Parches para WP-Cache
WP-Cache 2.0 es un sistema de cache de páginas realizado por Ricardo Galli (con algo de testeo y documentación por mí parte en los inicios ;) ) imprescindible para aliviar la carga del servidor y los tiempos de carga de los blogs basados en WordPres…
September 11th, 2006 at 8:31 am
[...] Credit: Chris Stormer [...]
October 2nd, 2006 at 10:10 pm
[...] Chris Stormer [...]
October 22nd, 2006 at 7:19 am
[...] http://chrisstormer.com/2006/07/08/bad-behavior-wp-cache-gzip-solution/ or http://markjaquith.wordpress.com/2006/01/31/wp-cache2-and-gzip/ [...]
October 22nd, 2006 at 8:48 am
Hello Chris, You might be interested checking out an enhanced way of adding gzip support to wp-cache , which caches the gzip output , avoiding to compress it again every time a client requests it.
You can find it
here
If you could try it / verify it works that would be great!
October 29th, 2006 at 8:59 pm
Nice short tutorial Chris.
Do you have BB and WP-Cache running here?
November 28th, 2006 at 6:34 pm
Ajay,
Actually I turned off BB mostly because I was catching most of the spam with other menthods and I’m always trying to eek out every ounce of speed I can snag.
February 7th, 2007 at 12:11 am
Hi,
i’m just wondering about advanced-cache.php , isn’t the wp-content/ supposed to be just a symbolic link?
March 22nd, 2007 at 1:14 am
[...] Mark Jaquith and Chris Stormer have found that a minor change in the the code of the plugin can turn on GZip [...]
March 23rd, 2007 at 12:50 am
[...] Mark Jaquith and Chris Stormer have found that a minor change in the the code of the plugin can turn on GZip [...]
July 26th, 2007 at 12:55 am
Hello!
Does this solution involve compressing the cached file each time it’s accesed?
July 28th, 2007 at 7:37 pm
[...] How to set up compression depends on your application and web server software. If you’re using Apache, you can have the server do it for you for normal files. For dynamic content such as that generated by PHP it depends. In WordPress there’s a switch in the Options. If you’re using wp-cache like Playing With Wire is, it may take some more work. [...]
August 13th, 2007 at 7:47 pm
[...] issues that may arise. If you’re a real performance junkie you may be interested in a simple hack to enable gzip with [...]
August 17th, 2007 at 11:30 am
content is compressed each time, but many tests show that this actually works faster since there’s less output to send out, than with uncompressed content, thus pages are served faster
ps. Chris, this page is all broken in my firefox ? Sidebar is covering the part of the content…
September 21st, 2007 at 1:14 pm
[...] the official WP-Cache suggests to disable GZIP support, there are some hacks(1, 2) to enable it. That is quite [...]
October 13th, 2007 at 7:05 pm
Step 5: Activate Gzip ;)
October 13th, 2007 at 10:57 pm
[...] I found this hack on chrisstormer.com [...]
November 5th, 2008 at 10:32 pm
In terms of bonalnoy erudition – grammotno done!
November 7th, 2008 at 3:53 pm
[...] issues that may arise. If you’re a real performance junkie you may be interested in a simple hack to enable gzip with [...]
November 26th, 2008 at 9:41 am
[...] issues that may arise. If you’re a real performance junkie you may be interested in a simple hack to enable gzip with [...]