Wordpress WP-Cache with GZip Compression enable

What is WP-Cache?
WP-Cache is an extremely efficient WordPress page caching system to make your site much faster and responsive. It works by caching Worpress pages and storing them in a static file for serving future requests directly from the file rather than loading and compiling the whole PHP code and then building the page from the database. WP-Cache allows to serve hundred of times more pages per second, and to reduce the response time from several tenths of seconds to less than a millisecond. (From: WP-Cache homepage)
How to have WP-Cache with Gzip compression enable?
The default WP-Cache plugin do not support gzip compression. If you would like to turn on WP-Cache with gzip compression you need to do some hacking. Here are the steps:-
1st:
Download the latest version of WP-Cache
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) {
That’s it! and now your site should be fast enough!
Credit: Chris Stormer
Tags: blogging, blogging tools, Software, Web, web application, Wordpress, wordpress hack, wordpress plugin, wp cache, wp cache hack
Posted at September 11th, 2006 by chua
If you think this article helps you to solve your problem and clear your headache, feel free to buy me a drink :)


September 14th, 2006 at 1:47 pm
[...] Beim WeatherIcon Plugin handelt es sich um die v3, welche noch im Beta-Status läuft, aber anscheinend keinerlei Probleme macht, kann man empfehlen, falls man solch eine Spielerei wirklich will. WP-Cache hatte mich dafür noch mehr genervt mit dem Hinweis auf 0 cached paged, dafür weiß ich nun vermutlich, woran es happert. Im Grunde funktioniert WP-Cache2 ohne Probleme, aber nach dem Einbau des "Weissen-Seiten"-Fixes und des gzip-Fixes scheint es so, als läd WP-Cache2 mutwillig keine Seiten aus dem Cache mehr (0 cached paged) – aber sortiert jene bereitwillig gerne in den Cache-Ordner. Es scheint, als fehle ein Timestamp..oder aber, es wird falsch vergeben oder ausgelesen – nur leider scheitert mein Wissen an diesem Punkt.. [...]
October 3rd, 2006 at 1:00 pm
[...] Techie Corner [...]
October 22nd, 2006 at 11:45 pm
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
October 27th, 2006 at 9:28 am
Thanks, this is a great tool.
November 30th, 2006 at 10:44 pm
[...] Wordpress WP-Cache with GZip Compression enable – Techie Corner [...]
December 19th, 2006 at 1:15 am
[...] Added AJAX Comments and enabled caching for faster response times, as our host has been kind of slow of late. As a web software developer, I’m a bit in love with AJAX at the moment, so I couldn’t resist the temptation to add it to our site. [...]
May 18th, 2007 at 1:00 am
[...] Ricardo Galli Granada’s WP-Cache, and adjusted it a bit to enable gzip compression using this [...]
June 11th, 2007 at 5:12 am
[...] http://www.techiecorner.com/25/wordpress-wp-cache-with-gzip-compression-enable/ Tags: wordpress, blog, cache, gzip(del.icio.us history) [...]
June 12th, 2007 at 4:35 pm
[...] 翻译自: Wordpress WP-Cache with GZip Compression enable [...]
July 18th, 2007 at 11:08 pm
[...] according toRussell: http://codex.wordpress.org/WordPress_FeaturesRussell: this pageJase: http://www.techiecorner.com/25/wordpress-wp-cache-with-gzip-compression-enable/Jase: shitzuJase: you going to show me the mockupRussell: yeahRussell: hold on a secondJase: [...]
August 11th, 2007 at 2:57 am
[...] to backup everything in case it doesn’t work. Anyway, here’s the method I followed to update my wp-cache files. Remember, you should still keep gzip disabled in WordPress. Editing the wp-cache code makes the [...]
August 22nd, 2007 at 4:57 am
im having problems with wp-cache expiry time settings but recently i was notified by my hosting of cpu overloads. is it better to use wp’s built in cache?
September 22nd, 2007 at 4:14 am
[...] the official WP-Cache suggests to disable GZIP support, there are some hacks(1, 2) to enable it. That is quite [...]
October 24th, 2007 at 11:06 pm
[...] Enable GZip with WP-Cache – Most people know about #3, but what about gzip with WP-Cache. By default, you have to turn off gzip when you’re running WP-Cache. However, that doesn’t mean you can’t use it and you definitely should be since it reduces the size of all Javascript and CSS files.You can find out how to enable gzip with WP-Cache by reading more here. [...]
November 9th, 2007 at 2:55 pm
I cant do
4th:
Edit: /wp-content/advanced-cache.php
for some reason advanced-cache.php is showing up as a folder
im running WP 2.2.3 & WP cache Version: 2.1.2
I tried to disable, deactivate,no luck
any idea’s
Jason
November 13th, 2007 at 7:52 am
Hi!
Which files should be “hacked” in WP 2.3? Cache File only!?
Thx
Heiko
P.S. You need the “send my a mail if someone write a feeback” Plugin
November 20th, 2007 at 6:40 pm
[...] soluciones son ésta y ésta, aunque parece que no siempre [...]
May 2nd, 2008 at 7:40 pm
[...] http://www.techiecorner.com/25/wordpress-wp-cache-with-gzip-compression-enable/ [...]
May 31st, 2008 at 7:49 am
[...] – Ativar Compressão de HTTP “HTTP Compression” Usando o plugin wp-cache2 através do hack descrito aqui. [...]
September 25th, 2008 at 11:45 am
[...] 一用上 WP-Cache 就不能用 Gzip 了, 这应该也是出于对服务器的考虑. 但是如果我就是想要开 Gzip 来省流量的话, 怎么办呢? 现在有办法了. 1. 下载最新版的 WP-Cache 2. 关掉 gzip 的选项 3. 编辑 wp-cache-phase1.php 文件: 在 foreach ($meta->headers as $header) { header($header); 前面添加 if ( extension_loaded(’zlib’) ) ob_start(’ob_gzhandler’); 4. 编辑 /wp-content/advanced-cache.php 文件: 在 foreach ($meta->headers as $header) { 前面添加 if ( extension_loaded(’zlib’) ) ob_start(’ob_gzhandler’); 大功告成! P.S.: 我以前的 blog 一页有300多k, 加了之后也就几十k… Gooooooooooooooood.! ^_^ 翻译自: Wordpress WP-Cache with GZip Compression enable [...]
March 10th, 2009 at 10:39 pm
how to turnoff the gzip