Antiguo y abandonado blog de Ricardo Galli :-(

Wednesday 4/5/2005

WP-Cache 2.0

Filed under: General — gallir @ 16:05

wp-cache-2 plugin

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.

WP-Cache started from the “Staticize Reloaded” by matt and billzeller. Most of their recommendations also apply to WP-Cache. Current version, WP-Cache2, is a huge improvement over previous versions of WP-Cache.

A note about compression

Due to several glitches created by enabling compression (inside PHP via ob_start()) this WordPress feature is not supported by WP_Cache. If you still need compression it’s better to enable transparent compression in php.ini:

zlib.output_compression = On

It works perfectly with WP-Cache.

If you cannot change it or the your server does not allow to enabled it then you don’t need compression at all, or you should look for a better hosting :-)

Introduction

wp-cache-2 plugin file list

WP-Cache is composed of two parts:

  1. Two-phases Wordpress hooks. The first is called at the very begining –wp-cache-phase1.php– when just few code has been compiled. The second –wp-cache-phase2.php– after all plugins have been executed. The first phase checks if the requested URL is already cached, if so it serves from the static file and finishes. The second phase stores the generated page in a static file for future requests.

  2. The WP-Cache plugin. This plugin configures and manages the whole process. It is easy to use and self-documented. It allows you to enable or disable cache, define expiration time for static pages, define rules for rejecting and accepting which URLs and php files can be cached, and shows and delete pages in cache.

Downloading

Version 2.1.2. More info about this versión.

WordPress Plugin Repository (log)

Installation

  1. Upload to your plugins folder, usually wp-content/plugins/ and unzip the file, it will create a wp-content/plugins/wp-cache/ directory.

  2. If you have Gzip Compression enabled turn it off (in Options->Reading).

  3. Activate the plugin on the plugin screen.

  4. Go to “Options” administration menu, select “WP-Cache” from the submenu, the plugin will try to autoconfigure everything. The plugin will try to autoconfigure everything and guide you through the process. In case of failure –normally due to the lack of files’ privilegies– it tell you and give the instructions to solve the problems.

Manual Installation

In case you don’t want to make wp-config.php writeable by the server, or you want to make all steps manually:

  1. Upload to your plugins folder, usually wp-content/plugins/ and unzip the file, it will create a wp-content/plugins/wp-cache/ directory.

  2. If you have Gzip Compression enabled turn it off (in Options->Reading).

  3. Create wp-content/cachedirectory and make sure the web server can write in it.

  4. Make wp-content writeable by the web server.

  5. Create a symbolic link from wp-content/advanced-cache.php to wp-content/plugins/wp-cache/wp-cache-phase1.php.

    ln -s wp-content/plugins/wp-cache/wp-cache-phase1.php wp-content/advanced-cache.php

  6. Add the following line to your wp-config.php file:

    define(’WP_CACHE’, true);

  7. Go to “Options” administration menu, select “WP-Cache” from the submenu and enable cache.

Frequently Asked Questions

Do I really need to use this plugin?

From “Staticize Reloaded”. Probably not, WordPress is fast enough that caching usually only adds a few milliseconds of performance that isn’t really perceptible by users. Some reasons you may want to use Staticize Reloaded:

  • If your site gets Slashdotted
  • If you’re on a very slow server
  • If you’ve had a complaint from your host about performance

How can I tell if it’s working?

WP-Cache adds some stats to the very end of a page in the HTML, so you can view source to see the time it took to generate a page and rather it was cached or not. Remember that the cache is created on demand, so the first time you load a page it’ll be generated from the database. This first time WP-Cache will add a lines with the total time needed to create the page, if the page is directly served from the cache, it adds a second line telling it was served from cache.

I see gibberish on the screen when I activate this plugin?

Make sure that you deactivated compression on the Miscellaneous options screen and that gzip encoding is turned off on the PHP level.

How do I make certain pages stay dynamic?

You can specify rules that reject request based on URI strings and also specify acceptable files for caching.

How do I make certain parts of the page stay dynamic?

It’s compatible with Staticze Reloaded. From their FAQ:

There are two ways to do this, you can have functions that say dynamic or include entire other files. To have a dynamic function in the cached PHP page use this syntax around the function:

<!--mfunc function_name('parameter', 'another_parameter') -->
<?php function_name('parameter', 'another_parameter') ?>
<!--/mfunc-->`

The HTML comments around the mirrored PHP allow it to be executed in the static page. To include another file try this:

<!--mclude file.php-->
<?php include_once(ABSPATH . 'file.php'); ?>
<!--/mclude-->`

That will include file.php under the ABSPATH directory, which is the same as where your wp-config.php file is located.

I removed WP-Cache and now Wordpress does not work

This occurs because Wordpress still tries to run advanced-cache.php. Remove or comment out the following line to you wp-config.php file:

define('WP_CACHE', true);

Screenshots

This is a chart showing the performance of a WordPress blog under very high loads with and without Staticize. It was taken similarly to this post.

Average load

Average load, logarithmic scale

WP-Cache plugin

WP-Cache plugin, listing files in cache

377 Comments

  1. Continued great work here.. glad to see it moving forward. I might have to back-port it to 1.0 if I’m not moving to 1.5 quickly… ;)

    Two quick suggestions:
    1. it’d be nice if there were an ‘accept-only’ mode, where ONLY those in the ‘always accept these’ box are cached. I use a similar method in my hacked Staticize for CHAITGEAR — I just list the particular files I want it caching, as I know those better than I know what I DON’T want cached (easier to list inclusive rather than exclusive!).
    2. I haven’t poked through the code yet, but I’m hoping you are looking at the executing script filename rather than just the URI? for nice URIs, something like ‘index.php’ wouldn’t show up, yet I might want to never cache my normally-dynamic pages (obviously, this is in line with the first point!).

    -d

    Comment by David — Thursday 5/5/2005 @ 5:25

  2. >1. it’d be nice if there were an ‘accept-only’ mode, where ONLY those in the ‘always accept these’ box are cached.  I use a similar method in my

    Good idea, I will add it.

    Altought you can get the same result by specifying a slash (”/”) in the “rejections” wich will reject every url, and then add “index.php” to “acceptable files”.

    >2. I haven’t poked through the code yet, but I’m hoping you are looking at the executing script filename rather than just the URI? for nice URIs, something like ‘index.php’ wouldn’t show up, yet I might want to never

    For the “accept”, it does so, for rejection, the URI. I think this way gives a finer control (as shown above) .

    Comment by gallir — Thursday 5/5/2005 @ 11:29

  3. Could you check this in the the plugin repository?

    Comment by Matt — Friday 6/5/2005 @ 1:22

  4. Ok, I found the common pattern, I think I solved. It seems to me a very nasty PHP4’s bug.

    Your servers do not have semaphores, so wp-cache fallbacks to flock() and uses a global variable that stores the filename of the lock file. But php4 does not make (that’s the bug) that variable global if it’s declared in a included file.

    I just uploaded beta4 which fixes this, it should work now.
    http://mnm.uib.es/gallir/wp-content/wp-cache-2-0-beta4.zip

    Thanks for testing.

    Cheers.

    PS: I will delete all previous messages so we start clean again :-)

    Comment by gallir — Friday 6/5/2005 @ 21:02

  5. Everything installed ok, but for some reason the ‘Rejected User Agents’ box isn’t showing. I’ve tried reuploading, and also my local install shows the box (using the same files!). I’m not too bothered but if I want to add another agent can I just add `N => ‘botname’` to config sample?

    Comment by Ian — Friday 6/5/2005 @ 21:14

  6. For some reason (it should if it’s >= 4.3, perhaps a missing module?) your server’s PHP version does not have this function, so there is no point in configuring it if it’s no going to work.

    Comment by gallir — Friday 6/5/2005 @ 21:26

  7. I also don’t get the ‘Rejected User Agents’ on a server that runs redhat ES stock php rpm … 4.3.2, but on my local box and another server php 4.3.11 its ok.

    Comment by jaume — Friday 6/5/2005 @ 22:04

  8. Great plugin! I’ve been having some ongoing issues:

    (1) Dynamic Pages

    I’m having an issue with a dynamic email form page I have with Internet Explorer 6. The form submit gets cached, so the php doesn’t run. So I added the name of the file, email-dave.php, to the REJECT list so it won’t be cached. . The full URL is http://davidseah.com/wordpress/email-dave.php.

    It works in Firefox on XP and also in Safari on Mac OS X: the php script executes properly. However, in Internet Explorer 6 on Windows XP, I get a 404 FILE NOT FOUND error from the browser. If I disable the caching entirely, though, it works. Perhaps this is related to the user agent rejection code? The reported version of IE is 6.0.2900.2180.xpsp_sp2_gdr.050301-1519.

    (2) Cookies

    Just a comment, I have more than just wordpress-related cookies on my site. Since these cookies change somewhat more frequently and are not related to wordpress, would it make sense if wp-cache actually only used, say, the wp-user-* cookie as a key, rather than ALL of them on the site?

    Form submission page issues is what has been plaguing me for the past few weeks with wp-cache.

    Comment by Dave — Saturday 7/5/2005 @ 2:05

  9. If I deactivate the plugin from the Plugin page without first deactivating the cache on the wp-cache Options page, that leads to errors. I have to deactive on the Options page before deactivating the plugin.

    Is it possible to also disable the caching when one deactivating the plugin?

    Comment by Dave — Saturday 7/5/2005 @ 2:36

  10. It seems to me that you are not only “deactivating”, but moving/removing the whole wp-cache directory or files. If you do that, you should remove the “define(’WP_CACHE’, true)” from wp-config.php.

    That is failing because Wordpress calls to advanced-cache.php, which is a dangling link or does not exist if you removed it.

    Comment by gallir — Saturday 7/5/2005 @ 2:43

  11. unziped, uploaded, made wp-content 775 - ugh, that was recursive on all templates… does it have to be 775? or even 777 maybe? CHMOD, I mean. Anyway, made wp-config writable 766 CHMOD, plugin activated. NOTHING, no cache directory created, no cache files, nothing when I go to options : wp-cache (except the link).

    any ideas?

    Comment by marlyse — Sunday 8/5/2005 @ 7:33

  12. To #11,
    very strange the WP-Cache plugin is not called/exceuted from the “Options” menu. Could you see the HTML source? Can you send it to me?

    PS: the plugin enables the cacheing process, so it’s normal you don’t get populated the cache yet.

    Comment by gallir — Sunday 8/5/2005 @ 12:48

  13. Hi,
    gret plugin! But I was wondering if ther is a way to includes folders in the name of files that have t obe cached? Or even regular expressions? For example, I have a folder called pictures that resides in wp-content. I could specify every file in pictures, but that would be tedious…

    Thanks!

    Comment by didier — Sunday 8/5/2005 @ 17:50

  14. To #13:
    pictures are already static files and they don’t need to be cached.

    Comment by gallir — Sunday 8/5/2005 @ 19:51

  15. Thanks for your fixes and looking at my site issue, Ricardo. I dumped my crusty WP 1.0 script for email form submit and am using Ryan Duff’s WP-ContactForm. A couple new issues I came across:

    (1) There seems to be a conflict though for the OPTIONS configuration when both WP-Cache and WP-ContactForm are installed. When WP-ContactForm is activated, the WP Cache options no longer display. You can see the WP-Cache tab at the top of the admin->options screen, but clicking on it shows only a “blank” screen: the WP Admin frame shell, basically, with no controls of any kind. When I disable WP-Contact Form, the problem goes away. WP-ContactForm and WP-Cache are the only plugins I have that have the custom WP-Admin Option Config pages.

    http://ryanduff.net/projects/wp-contactform/

    (2) A feature: It would be nice to see some kind of cache utilization statistics, either on the Admin Option screen for the plugin where you set the timeout, or perhaps on the “static page served” comment. I had hacked a simple PHP counter into the earlier version to try to figure out what kind of cache-hit rate I was getting, and used this to tune the cache timeout to a more useful number than the default of 3600 seconds.

    Thanks!

    Dave

    Comment by Dave — Sunday 8/5/2005 @ 22:03

  16. To Dave:

    (1) I took a look to wp-contact-form to see if there was some namescpace conflict, but it seems it wasn’t. Nevertheless I sanitized all wp-cache function names and released 2.0.1. Just in case, but I don’t believe this is a problem.

    (2) The problem is wp-cache should write a file for every access, this plus the necessary concurrency control will generate a lot of overhead.

    Comment by gallir — Sunday 8/5/2005 @ 23:37

  17. After trying 2.01, I saw no change. But I did find a reference to a WordPress 1.5 bug: http://mosquito.wordpress.org/view.php?id=902

    Apparently, if you have more than one options page, only the last one loaded works. The solution was to grab the fixed version of wp-admin/menu-header.php out of their repository. My WP-Cache menu items show again…hooray!

    Regarding the overhead for writing statistical information:

    Yes, I see…that would defeat the purpose to some degree. Though if the overall goal is to optimize system load, it would be useful to have some kind of profiling tool. Perhaps a future version could have a “profiling option” that is turned on ONLY for profiling, but is not intended to be left on all the time. Just a suggestion…if there are better ways to do this with other tools (keeping in mind that I am on a shared server), then any suggested approaches are appreciated.

    Thanks again for your great work,

    Dave

    Comment by Dave — Monday 9/5/2005 @ 4:46

  18. I installed the plugin and works correctly, except that it does display weird characters when on words that have accents. I have noticed than 1st time I load a page is ok, but when requesting it again (cached page) it displays those weird characters. If I deactivate plugin (run from php), words are displayed correctly.

    have someone the same problem or you just don’t use accents ?

    Comment by Toni — Monday 9/5/2005 @ 10:16

  19. I’m using accented characters (this blog :-) ), that occurs because your apache/php does not provide http headers. Please check them with and without wp-cache and paste them here. May be you have one character set in WP and another one in the apache configuration. If so, change it in WP or take it out from Apache. [1]

    It might happens also that there is some PHP warnings and the headers are lost. Please check the html code of those wrong pages to see if there is any error message.

    You can also send me a couple of generated .meta files so I can check which headers are missing.

    [1] BTW, although this problem is due to misconfiguration, I’m thinking wp-cache can grab the content-type directly from WP conf. I’ll try it later today.

    Comment by gallir — Monday 9/5/2005 @ 10:32

  20. My problem resolved…

    wp-content directory needs be writable by the server because when you enable wp-cache in wordpress, create wp-cache-config.php file and need it.

    chown www-data.www-data wp-content

    Comment by davidcg — Tuesday 10/5/2005 @ 2:50

  21. The plug in seems to be working fine, but I get this error at the top of my admin window, and each freshly loaded page:

    Warning: semget() failed for key 0×152b: Permission denied in /wordpress/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 76

    Any idea whats causing this?

    Comment by Steve — Thursday 12/5/2005 @ 14:13

  22. Nice work, Ricardo!

    I think you may have a little bug: While apache_response_headers() returns an associative array with key-value pairs, headers_list() returns an array with numerical keys, and the value contains the whole header

    Array { [’Content-Type’] => ‘text/html; UTF-8′ }

    Array { [0] => ‘Content-Type: text/html; UTF-8′ }

    If I am not mistaken.

    Comment by Sencer — Thursday 12/5/2005 @ 14:38

  23. Wonderful plugin. Caching is new to me so I have a few basic questions that I didn’t see discussed elsewhere.
    1. Does wp_register() and wp_login() template tags need wrapping around them to avoid showing cached versions (register/siteadmin, edit-links etc) to the public or how does it work? I tested this by accessing with two browsers (ff&ie) at the same time, logging in with the other and it seems to serve different cache to the one where I logged in, so everything is miraculously ok by itself without mods?
    2. After a few minutes of fiddling, there are five versions of the frontpage (root) in the cache, is this ok, hopefully all users don’t have their own separate cache? :) I don’t know anything about caching, is this related to different browsers, cookies, or what?
    3. And lastly, I understood that the whole cache expires when a change is made to any page, post, comment etc. This is most useful, but just out of curiosity, are there any exceptions when this would not work? Of course changing templates does not expire the cache, but then I can delete the cache from admin options which is nice.

    Comment by Pete — Thursday 12/5/2005 @ 15:58

  24. …in addition to previous questions, I guess it should be straightforward to generate the random link list dynamically, but why doesn’t the following work? (hopefully the code appears correctly below)
    ‘, ”, ‘ ‘, ‘FALSE’, ‘rand’, ‘FALSE’, ‘FALSE’, ‘50′, ‘FALSE’, ‘TRUE’) ?> –>
    ‘, ”, ‘ ‘, ‘FALSE’, ‘rand’, ‘FALSE’, ‘FALSE’, ‘50′, ‘FALSE’, ‘TRUE’) ?>

    Comment by Pete — Thursday 12/5/2005 @ 16:49

  25. Before messing my site up completely…
    How does this plugin behave if I have multiple themes installed?
    Does it cache different copies of a page for the different themes or will it just cache the default theme?
    (I hope it won’t cache the page with the first theme used to display it…)

    Comment by DElyMyth — Thursday 12/5/2005 @ 16:51

  26. …well, it didn’t show up properly, but it was an example of displaying random selection of links using get_links() wrapped in mfunc-thingies, I guess quite many have that kind of thing on their sites, but I cannot get it refresh on reload with wp-cache..

    Comment by Pete — Thursday 12/5/2005 @ 16:53

  27. To #21: it seems it’s a problem creating semaphores. Very strange, it’s a problem of your php4 installation.

    To #22: You might be right, I will check it tonight (or in following days, I’m leaving to USA in few hours :-) )

    To #23:

    1. If you check the “rejection panel” you will see that any URI with the string “wp-” is not cached.

    2. Any “non anonymous” user get her own cache version due to their own cookies. It’s normal and should be so.

    3. Yes, any change will delete all cached files, except a “moderation” because WP don’t (or didn’t in 1.5.0) have a hook for calling a function after a comment has been aproved in the moderation.

    Comment by gallir — Thursday 12/5/2005 @ 16:55

  28. To #25:

    ¿How do you select a theme? If it uses users’ cookies, it should work. WP-Cache take in account those cookies that identify non-anonymous users.

    If the theme selections are using different cookies (I have no idea), it’s not a problem just tell me their names and I can add them.

    Comment by gallir — Thursday 12/5/2005 @ 16:59

  29. ” it seems it?s a problem creating semaphores. Very strange, it?s a problem of your php4 installation.”

    This is the generic PHP as given to me by my host, powweb.com.
    What can I do to fix it?

    Comment by Steve — Thursday 12/5/2005 @ 21:49

  30. To #29, Steve

    You can try two thing.

    1. First try changing the $sem_id value en wp-cache_config.php.

    2. If the previous does not work, try uncommenting the following line inf the same file:

    $use_flock = true; // Set it tru or false if you know what to use

    The last will force wp-cache to use flock() instead of semaphores.

    Hope this helps.

    Comment by gallir — Thursday 12/5/2005 @ 22:36

  31. Great plugin. But it needs to recache the pages that’s commented or pinged.

    Comment by Kyrre Baker — Friday 13/5/2005 @ 3:51

  32. Al activar el wp-cache, los acentos de mis paginas también se sustituyen por cosas raras. He hablado con mi proveedor de hosting y me dice que su php es una instalación estandar que viene con redhat enterprise. Se puede resolver este problema sin tener que depender de la instalación de php del hosting? …. es extraño, pero si desactivo el wp-cache los acentos aparecen de nuevo.

    Comment by Manu — Friday 13/5/2005 @ 9:31

  33. The cookie for the theme is $_COOKIE[’wptheme’.COOKIEHASH] (taken from my code, it displays the theme name as well as the comment_author name in the top of the pages).
    It comes directly from the theme switcher plugin.
    Anyway, I hope I can try to install it in this weekend, I have some pages with hundreds of comments which are quite heavy, and also a big link-list where I put all the books I plan to read and buy and this is heavy too.
    Not really too heavy, but it can slow the server down if too many users come at the same time I think.

    Thanks for the answer ;-)

    Elena.

    Comment by DElyMyth — Saturday 14/5/2005 @ 8:11

  34. Hola! There seems to be a problem with including dynamic functions - the code simply does not exist. :) When grepping “mfunc” only readme.txt mentions it, am I right?

    Comment by Pete — Sunday 15/5/2005 @ 2:57

  35. Yes, you are right, only “mclude” is checked… I will check it out against stiticize to assure compatibility (it it does implement mfunc…).

    Thanks

    Comment by gallir — Sunday 15/5/2005 @ 4:30

  36. Ricardo, excellent plugin. :-) However one small problem. I have just installed the Subscribe to Comments plugin (http://txfx.net/2005/03/28/wp-subscribe-to-comments-20-alpha-2/) and for some reason their WP Admin panel and yours are clashing (under Options). If you disable WP-Cache you can use their admin, otherwise you cannot.

    Comment by NP — Sunday 15/5/2005 @ 19:53

  37. The next version of WP-Hashcash (2.11) will automatically detect the WP-Cache definition and work nicely with it! Great work, I love this product ;)

    Comment by Elliott Bäck — Monday 16/5/2005 @ 21:05

  38. I’m having a similar problem as #36. When I have the WordPress Email Notification Plugin v2.1.1 ( http://watershedstudio.com/portfolio/software/wp-email-notification.html ) the Options WP Cache admin pannel is just blank. By de-activating the Email notification plugin, I was able to complete the install and activation of WP-Cache. But once I re-activated the Email notification plugin, the WP-Cache options admin panel is now gone. The caching continues to work, I just can’t get to the options menu anymore. The Email plugin also has an Options control pannel, so perhaps they are somehow stepping on each other (Email plugin’s pannel still works like normal).

    Comment by Mike Martin — Tuesday 17/5/2005 @ 1:00

  39. #36 & #37

    I had a similar problem…it apparently is a bug in WordPress 1.5. Upgrading to 1.5.1 will probably fix it, or see what I did (see comment #17)

    Comment by Dave — Tuesday 17/5/2005 @ 6:46

  40. Hi, just to let you know, expire time textfield could use some validation perhaps. I accidentally copypasted 86 400 (with space) and the site went completely blank. Disabling caching from wp-config.php didn’t help, as the plugin got called anyway and as admin-area was blank too no way to press wp-cache’s restore configuration.. Renaming the plugin file helped but when renamed back the plugin was activated automatically, so no help there either. As I’m running on hosted environment couldn’t modify wp-cache-config.php where cache_max_time was stated now wrongly (these webserver made files make me/users crazy sometimes) but luckily I could rename the file, wp-cache wrote a default one, and later I found out I could delete the old renamed config file. So now everything is ok!

    Btw, is 24 hours long expiration time somehow bad? I could make it longer still, I have just a few visitors but I like to optimize the user experience — this is so convenient way to cache for me and those few 1+n visitors too.

    Comment by Pete — Tuesday 17/5/2005 @ 15:50

  41. Dave … Thanks! I followed the patch for the bug you linked to in #17, and now the options menus are both showing correctly. Thanks!

    Comment by Mike Martin — Tuesday 17/5/2005 @ 18:31

  42. To **Pete**.

    Thanks for your bug reports, very useful. Right now I’m in California with no much time for hacking, but in few day I¡m going back to Mallorca. So early next week I’ll release a new version with your suggestions.

    Comment by gallir — Wednesday 18/5/2005 @ 3:49

  43. Ricardo- you said:
    “First try changing the $semid value en wp-cacheconfig.php.
    If the previous does not work, try uncommenting the following line inf the same file:
    $use_flock = true; // Set it tru or false if you know what to use”

    Uncommenting the line worked, thanks, but I’m wondering, is it better to do it the first way, performance wise? I wouldn’t know what to change the sem_id to.

    Comment by Steve — Wednesday 18/5/2005 @ 16:46

  44. ricardo, como andas?

    My host yesterday took down my site… I’ve just installed this plugin and my site seems to be working fine … but i dont see the code in the source… so.. i got no idea if this is really working or not :s

    sorry if this is lame :S

    Comment by mariano — Wednesday 18/5/2005 @ 23:33

  45. Hi. I really want to use your plugin but I’m having a strange problem. When I click on WP-Cache in the options I get this error:

    Fatal error: Cannot redeclare wp_cache_add_pages() (previously declared in c:\phpdev\www\wp-content\plugins\wp-cache\wp-cache.php:74) in c:\phpdev\www\wp-content\plugins\wp-cache\wp-cache.php on line 73

    And of course I can’t do the other method of installing because I’m using a windows PC as a server. Can anyone help?

    Comment by Mayan Obsidian — Friday 20/5/2005 @ 8:27

  46. Hi there,

    i like the idea of caching my site, but I have a strange problem:

    if I activate the wp-cache plugin, I can no longer access the confg menu of my PHOTOPRESS plugin (http://www.mydomain.com/wp-admin/options-general.php?page=photopress.php). The menu entry is still there, but it leads me to the wp-cache menu! What’s going on there?

    (Since I don’t know if this is a bug of the photopress plugin, I will post my message there, too)

    Can anyone help? I need both plugins!

    Comment by Raphael — Friday 20/5/2005 @ 13:59

  47. Gallir, question concerning cookies..
    Firstly, when I check from WP-Cache Manager some cached pages, and browse to them (logged out) it sometimes generates a new page and sometimes serves from cache. Also I have something like 8 versions of index.php cached but I think not all of them are for separate logged in users.. Not sure about this, I have very few visitors in general and many might be now generating pages that are already cached..? Sometimes I see many same feed-urls in cache, but that is highly unlikely to be due to logged in visitors. Of course when I reload the page it comes from cache, but I don’t know how many different visitors certainly get a cached page. Does operating system, browser, position of the moon affect this? :)
    Secondly, I just tried polyglot (language picker) plugin, and is it ok to rename its cookie starting with “wordpress_” or is that a wrong way to make it compatible with wp-cache? I’m browsing through the code trying to understand how this cookie business is handled.. This point might be related to my first question, but I experienced same kind of double/triple-caching also before trying out polyglot.

    Comment by Pete — Monday 23/5/2005 @ 0:00

  48. To #47:

    Every user who has a cookie, including those that only wrote a comment and “saved” username and email, forces wp-cache to generate a specific page (they can see their names in the comment’s form).

    Comment by gallir — Monday 23/5/2005 @ 1:44

  49. I just installed WP-Cache on a WP1.5 blog & though it works fine on the blog, it has problem with the pages that WP creates, I mean that static pages. When I try to visit any page, it downloads onto my PC & it has junk characters in it. I’ve disabled the GZip from the WP Options. However, if I disable WP-Cache, then the page opens quite well.

    I added the page URL in the Rejected URI’s section but still no good.
    the URL is http://digit.igeek.info/. Click on the `About` link on top & it’ll download a file on your PC. The `Contact` link works only because its a seperate file & is not using WP at all.

    Can you help?

    Comment by Amit Gupta — Monday 23/5/2005 @ 13:36

  50. Ah, its working now, how I don’t know!!!!!

    Comment by Amit Gupta — Monday 23/5/2005 @ 13:39

  51. erm, sorry about my last post on getting it working, its actually I had disabled WP-Cache & didn’t notice it & hence the page was working. The issue is still there, can you please help?

    Comment by Amit Gupta — Monday 23/5/2005 @ 13:46

  52. To #49, 50, 51: It works perfectly from here…

    Pewrhaps you are still retrieving the wrong pages generated when gzip was enabled. Just clean your cache files if still you see garbage.

    Comment by gallir — Monday 23/5/2005 @ 13:54

  53. I was still getting it even after clearing my browser cache & re-starting my browser(IE6). So I just deleted WP-cache & re-installed it. Now it looks ok, don’t seem to generate any problems. :)

    BTW, I’ve changed the cache directory to be outside wp-content. so why does it still need write permissions in wp-content directory?

    Comment by Amit Gupta — Monday 23/5/2005 @ 21:17

  54. I get a blank web site… as in completely blank. :/

    Comment by Denis de Bernardy — Monday 23/5/2005 @ 22:24

  55. ### New version 2.0.2

    - Added mfunc sintax as in Staticize Reloaded 2.5,
    also keep tags but take out function calls
    - Check of numbers are really numbers in web forms.
    - Remove header_list function verification, its result are not
    the same.
    - wp-cache now verifies if gzipcompression is enabled

    Comment by gallir — Monday 23/5/2005 @ 22:36

  56. nevermind, problem is solved. Ahem… I cannot create a frikin link on my server. And I am probably not the only one in this case. ;)

    Thus, I got blank page. I fixed by manually creating a copy of the file. And now, the following error:

    advanced-cache.php link does not exist
    (…)
    Cannot continue… fix previous problems and retry.

    Just for you to know. ;)

    Comment by Denis de Bernardy — Monday 23/5/2005 @ 22:37

  57. When I use WP-Cache, my web site statistics are thrown off (specifically in Stattraq). Is there anyway to correct for this?

    Comment by Steve — Monday 23/5/2005 @ 23:52

  58. What do you mean with “statistics”? That’s way to general, perhaps you mean “some/a stats plugin”?

    I don’t know how stattraq works, if it’s executed for every problem, of course it won’t count if pages are cached.

    But… you could use “mfunc” or “mclude” syntax if the plugin is simple, see README.txt (altought don’t expect the same performance).

    Comment by gallir — Tuesday 24/5/2005 @ 1:24

  59. Nice work! Just one suggestion: It might be advisable to limit direct access to the cache directory (Deny from all) so people can’t go browsing cached files.

    Comment by Jürgen Kreileder — Tuesday 24/5/2005 @ 2:48

  60. Disallow directory listing and/or access in Apache, or just put an empty index.html page.

    Comment by gallir — Tuesday 24/5/2005 @ 2:58

  61. I think it would be more appropriate if the plugin would put a .htaccess in the cache directory.

    Comment by Jürgen Kreileder — Tuesday 24/5/2005 @ 3:13

  62. With wp-cache turned on, Stattraq (and I assume any web stats app, such as Webalizer or Awstats) only records hits to newly served pages, not the cached ones. I suppose I would need to hack stattraq to look at the cache directory somehow, but this seems complicated in terms of it knowing what each cached page is.

    You’re right, mfunc and mclude would work to a degree, but to use them would negate the purpose of caching in the first place :)

    Comment by Steve — Tuesday 24/5/2005 @ 5:02

  63. > (and I assume any web stats app, such as Webalizer or Awstats) only records hits to newly served pages

    No, they are unrelated, webalizer o awstats use the logs generated by Apache, which is the same for cached or uncached pages.

    Comment by gallir — Tuesday 24/5/2005 @ 9:59

  64. I have installed 2.0.2 version but I am having issues with weird characters on cached pages … seems I have same problem as #18

    Comment by steve — Tuesday 24/5/2005 @ 10:06

  65. Did you check your charset configuration? Do you have a default charset configured in Apache? Is it the same for Wordpress? Are you using Apache?…

    Comment by gallir — Tuesday 24/5/2005 @ 11:58

  66. in my testing for my own plugin, it seemed to me that apache_response_headers showed every header - except the Content-Type header, even it was explicitly set before. Hence why the Apache or PHP default-header kicks in, which also defines the charset.
    I “solved” it, by letting users define a custom Content-Type header in the configuration of the plugin.

    Interestingly headers_list does show the Content-Type header, but it is a) PHP5 only, 2) it appears to buggy and in certain setups only returns an empty array(). :-/

    Comment by Sencer — Tuesday 24/5/2005 @ 17:43

  67. Default charset in apache,php and wordpress is ISO-8859-1 and it works correctly when I disable wp-cache. Tried to set all to UTF-8 but same results.
    When wp-cache is enabled weird characters appear when files are being read from the caché files.

    Comment by steve — Wednesday 25/5/2005 @ 8:24

  68. Please test a patched version (2.0.2b) to see if it solves your Content-Type/charset problem.

    If so, I’ll make “official”.

    Comment by gallir — Wednesday 25/5/2005 @ 13:31

  69. Funciona !!! … resuelto el problema del charset !!! con la ultima version que pusiste .. lo que el zip pone 2.0.2a en lugar de 2.0.2b

    Gracias !!!

    Comment by jaume — Thursday 26/5/2005 @ 9:24

  70. I found that if the list of user agent strings to reject is empty WP-Cache gives an “empty delimiter” error message at line 56 in phase 2. The workaround is obviously to enter at least one UA string.

    Comment by Graeme Pietersz — Thursday 26/5/2005 @ 11:37

  71. ### New version 2.0.3

    2005-05-27: 2.0.3
    - Check for zero length of user agent and uri strings

    2005-05-24: 2.0.2a
    - As a workaround for buggy apache installations, create
    Content-Type header if is not retrieved from Apache headers.

    Comment by gallir — Friday 27/5/2005 @ 3:11

  72. I’ve installed the latest version on a Windows server and receive the following error when I click the WP-Cache tab on the Options page:

    Fatal error: Cannot redeclare wp_cache_add_pages() (previously declared in C:\Dev\wordpress\wp-content\plugins\wp-cache\wp-cache.php:88) in C:\Dev\wordpress\wp-content\plugins\wp-cache\wp-cache.php on line 87

    Any ideas how to fix this one?

    Comment by Mike — Sunday 29/5/2005 @ 6:04

  73. Hello,
    I love WP-CACHE, it just make my wordpress-based blogs fly!
    I fixed every little quirks but now I am left with one very annoying: using FeedBurner I discovered that very frequently feeds served and cached by WP and WP-CACHE are just empty!
    The only content is:

    So I decide to not force the cachinc of wp-rss* wp-atom* etc by inserting the respective file names in the WP-CACHE options panel but the /feed/ files are STILL cached!

    So to prevent having blank rss feeds I am forced to disable WP-CACHE completely but I don’t want to!

    Would you be so kind to help me in fixing this very annoying issue?

    Thanks very much and my sincere congratulations for this gem.

    (I love Menorca)

    Comment by HYPERGURU — Wednesday 1/6/2005 @ 21:42

  74. Add /feed to the “Rejected URI” panel, must work.

    Comment by gallir — Wednesday 1/6/2005 @ 21:45

  75. Add /feed to the “Rejected URI” panel, must work.
    Comentario por gallir — Miércoles 1/6/2005 @ 21:45

    AH!

    I will try it!

    Comment by HYPERGURU — Thursday 2/6/2005 @ 0:33

  76. I love wp cahce, cuz it helped me a lot, but i discovered a bug.

    i’ve noticed that sometimes when i get to my site, it only occurs when i get referred from ohter site
    i see these warnings before my site loads:

    Warning: Cannot modify header information - headers already sent in /home/domains/babeskickass-com/babeskickass/www_root/wp-content/plugins/wp-cache/wp-cache-phase1.php on line 36

    Warning: Cannot modify header information - headers already sent by (output started at /home/domains/babeskickass-com/babeskickass/www_root/wp-content/plugins/wp-cache/wp-cache-phase1.php:36) in /home/domains/babeskickass-com/babeskickass/www_root/wp-content/plugins/wp-cache/wp-cache-phase1.php on line 36

    Warning: Cannot modify header information - headers already sent by (output started at /home/domains/babeskickass-com/babeskickass/www_root/wp-content/plugins/wp-cache/wp-cache-phase1.php:36) in /home/domains/babeskickass-com/babeskickass/www_root/wp-content/plugins/wp-cache/wp-cache-phase1.php on line 44

    I’ve put “@” before those 2 rows with Header();…

    Can you tell me what’s wrong ith that ?

    Comment by miob — Tuesday 7/6/2005 @ 22:22

  77. It’s very stange because at that point no content should have be sent yet. Are you sure you didn’t add any space or blank line outsider the <? php delimiters?

    Check the wp-cache-phase1.php file again please.

    Comment by gallir — Tuesday 7/6/2005 @ 23:18

  78. Alright, 77 posts and no one has asked. Maybe Im the only one that doesnt get it, but I cant figure out how to keep my search function dynamic.

    This is the code Im trying to keep dynamic. Im calling two php functions in it..so maybe thats where Im getting hung up:

    “”>
    ” />

    Comment by Nick Luckett — Wednesday 8/6/2005 @ 5:03

  79. Whoops, my code didnt show up. Check it out here:

    www.4colorrebellion.com/stati.txt

    Comment by Nick Luckett — Wednesday 8/6/2005 @ 5:04

  80. So, what’s the problem? Move “bloginfo” funciton to a file and use the “mclude” syntax to include it instead of “<?php bloginfo(’url’); ?>”

    Comment by gallir — Wednesday 8/6/2005 @ 9:45

  81. Alright, I made a new php file called blog info. This is what I put in there:

    <?php bloginfo(’url’); ?>

    Then I called the function from inside my sidebar.php file like this:

    <form style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"
    id="searchform" method="get" action="<!–mclude
    blog-info.php–><?php include_once(ABSPATH . ‘blog-info.php’); ?><!–/mclude–>">
    <input type="text" name="s" id="s" size="20"
    onfocus="this.value=”" value="<?php if (!$s) { $s = "
    -Search 4cr-"; } echo $s; ?>" />
    </form>

    Is that the correct way? So far I havent been able to get it to work.

    Comment by Nick Luckett — Wednesday 8/6/2005 @ 21:16

  82. To #81:

    No, it’s wrong, please read above the question “How do I make certain parts of the page stay dynamic?”. Also explained in README.txt

    Comment by gallir — Thursday 9/6/2005 @ 1:56

  83. New version 2.0.4

    2005-06-09: 2.0.4
    - Avoid “fwrite() thrashing” at the begining of a connections storm
    - Send Content-Size header when generated dynamically too
    - Clean stats cache before deleting expired files
    - Optimized phase1, EVEN MORE! :-):
    removed random and extrachecks that were not useful in the context
    move checking for .meta at the begining

    Comment by gallir — Thursday 9/6/2005 @ 1:58

  84. Somewhere along the line keeping dynamic code going broke.

    This plugin:
    http://www.w-a-s-a-b-i.com/archives/2004/05/27/wordpress-random-witty-text-plugin/

    I thought it worked on a prior version. Witty works fine without wp-cache.

    Comment by Robert Accettura — Thursday 9/6/2005 @ 2:42

  85. ok, i installed 2.04 version, but you didn’t figure that error with Header() function on line 36 and 44 in file wp-cache-phase1.php, same warnings…

    Comment by miob — Friday 10/6/2005 @ 1:05

  86. No, I cannot reproduce it, I even cannot understand it. It should not occur at least you did modify any wp-cache file. Did you check it as I asked you?

    Comment by gallir — Friday 10/6/2005 @ 13:47

  87. i have copied newest version over old one. i didn’t modify anything after that, i just added @ before Header() function, now i’m not getting error warnings, what i had to check ?

    Comment by miob — Saturday 11/6/2005 @ 12:32

  88. By prefixing the function with “@” you are just hiding the problem. You are not fixing it.

    That error occurs because some HTML content was already sent to the client. So, check if you add some empty lines outside the PHP enclosing tags in your configuration files, i.e. wp-config.php and wp-content/wp-cache-config.php (see comment #77 too).

    Otherwise, you have some problem with you Apache and/or PHP modules.

    Comment by gallir — Saturday 11/6/2005 @ 12:43

  89. i know i’m just hiding the problem, i checked it and i have on the first row function ensuring counting traffic, this function causing any spaces, cuz after removal this row i had no problem, so i know that this has nothing to do with your script.
    thanx

    Comment by miob — Sunday 12/6/2005 @ 11:45

  90. Hi, could we have some upgrade instructions in the readme or here please? Just to make sure it’s done right. :-) Thanks.

    Comment by NP — Sunday 12/6/2005 @ 11:47

  91. To #90:
    Until now, all upgrades to wp-cache-2 only requires to overwrite the files in the plugins/wp-cache directory with the files in the zip file.

    That’s to say:

    cd wp-content/plugins
    unzip wp-cache-xxx.zip

    Comment by gallir — Sunday 12/6/2005 @ 14:06

  92. i have an issue with that yet, i thought i can take it over and put my tracking script after
    require(’./wp-blog-header.php’); in index.php file, but if i will do this my tracking script doesn’t load.
    i just need to put to my index file this row :
    if ((!EREGI(”babeskickass.com”,$HTTP_REFERER))&&($HTTP_REFERER)) virtual(”./cgi-bin/awgtrade/tradecnt.cgi”);

    where to put this row to get this thing working ?

    Comment by miob — Sunday 12/6/2005 @ 20:04

  93. Put it in a different file and use the mclude syntax, as explained in #58 and #80.

    Comment by gallir — Sunday 12/6/2005 @ 21:28

  94. Has anyone else noticed that pages only seem to be cached per user? Is that the intent?

    E.g. If I check the home page in Firefox and check the source, it is the first time it’s been loaded. I refresh and it servers a cached version. If I then check in IE, it is created dynamically again.

    Otherwise it all appears to be working fine, but then load tests only appear to be one person I guess, so it would perform well under tests.

    Comment by AlastairC — Monday 13/6/2005 @ 19:24

  95. To #94: Yes, it does it on purpose.

    Registered users have different pages (see the data in the comments’ form) and it’s not posible to have them in just one cache fro everyone.

    Comment by gallir — Monday 13/6/2005 @ 20:26

  96. Ah, thanks. I don’t have comments on, or other individual content, is there a way I might have one cache for everyone?

    Comment by AlastairC — Tuesday 14/6/2005 @ 19:06

  97. By returning a null string from wp_cache_get_cookies_values() in wp-cache-phase1.php. But it is dangerous, it could disclosure private information –usernames, email…– to all users.

    Comment by gallir — Tuesday 14/6/2005 @ 19:50

  98. So for example, if I was the first person to look at it, the ‘edit’ link would be visible to everyone else?

    Yea, I can see that would be bad!!

    Comment by AlastairC — Wednesday 15/6/2005 @ 0:28

  99. But also, (sorry for second comment, should have thought of this a moment ago), are all non-registered users getting the same cached version?

    If so, great, that is perfect!

    99% of users get the cached (quick) version, and I get the version with the edit button.

    Comment by AlastairC — Wednesday 15/6/2005 @ 0:33

  100. To #99: yes, all anonymous users (i.e. without any cookie) get the same cache.

    Comment by gallir — Wednesday 15/6/2005 @ 0:37

  101. Excellent plugin. Thanks :)

    Hopefully it will make my blog faster

    Comment by Michele — Wednesday 15/6/2005 @ 2:46

  102. Hi, Regarding - #94 - #100.
    I understand why you want to cache a page per wordpress_{user,pass} cookie to allow customization of the comments page(e.g. using username).

    But I dont know why we are using the comments_author_email cookie to generate the key in wp_cache_get_cookies_values(). This causes WP_Cache to store 2 pages per user - when the user has the cookie set(after posting a comment) and when the user does not have this cookie.

    Seems wasteful to me without adding any customization or security benefit

    Comment by Mayank — Wednesday 15/6/2005 @ 19:44

  103. To #102:

    First: WP-Cache does NOT cache any POST request.

    Second: your example occurs only when a new user posts the first time. Next times the cookie is already set.

    Comment by gallir — Wednesday 15/6/2005 @ 20:04

  104. Further to #13 and your reply. What about dynamically generated images? Are they/can they be cached?

    Comment by Graeme Pietersz — Thursday 16/6/2005 @ 12:56

  105. Do you have a a workaround for the sym link.. most hosts have a maximum rights issue of 755 .. and symbloic links are always 777. … this makes in impossible to sym link the two files….

    thanks

    Comment by ringo — Thursday 16/6/2005 @ 20:51

  106. for some reason mcluding a file.php that includes get_links() results in errors (function get_links() not found) in my setup. I tried requiring wp-blog-header.php in that file.php but it didn’t help.. would like to have a random link list generated dynamically on cached pages. any suggestions?

    also one usability hint: maybe you could insert #anchor in wp-cache manager’s cache content panel, so that “update list” and maybe some other buttons too would link to that anchor. somehow I tend to use that button quite often and you always have to scroll down again.

    Comment by Pete — Friday 17/6/2005 @ 21:57

  107. > for some reason mcluding a file.php that includes get_links() results in errors (function get_links() not found) in my setup. I tried requiring wp-blog-header.php in that file.php but it didn’t help.. would like to have a random link list generated dynamically on cached pages. any suggestions?

    Don’t use wp-functions, you cannot do it when the file is cached because no additional php (and obviously, no database connection) is executed. If you add dynamic code, everything must be defined in those included files. But don’t abuse, you will lose all cache advantages.

    > also one usability hint: maybe you could insert #anchor in wp-cache manager’s cache content panel, so that “update list” and maybe some other buttons too would link to that anchor. somehow I tend to use that button quite often and you always have to scroll down again.

    Nice suggestion. I’ll do it next version (just complain to me if I forget to do it :-) )

    Comment by gallir — Friday 17/6/2005 @ 23:23

  108. Your plugin rocks !!!
    Thanks a lot for it.

    Comment by Roman2K — Sunday 19/6/2005 @ 15:36

  109. Version 2.0.5

    2005-06-19: 2.0.5
    - Added “#anchors” to refresh cache files’ list
    (http://mnm.uib.es/gallir/wp-cache-2/#comment-4116)

    As always, just overwrite previous files with those in the zip file.

    Comment by gallir — Sunday 19/6/2005 @ 22:44

  110. Hi,

    I have started using it. I noticed that the time taken to load the page originally is published at the very end in a comment. However the time to serve cached page is not included. Is there any way to know how much time I am saving for a single request and also cumulatively?

    What I get:
    <!– Dynamic Page Served (once) in 1.972 seconds –>
    <!– Cached page served by WP-Cache –>

    Comment by Angsuman Chakraborty — Monday 20/6/2005 @ 16:54

  111. I took it out because it consumes some cpu cycles to give always zero.

    Comment by gallir — Monday 20/6/2005 @ 17:42

  112. That is great :)

    Thanks for the excellent plugin.

    Comment by Angsuman Chakraborty — Tuesday 21/6/2005 @ 20:29

  113. I was wondering if you could incorporate a way to show the total time saved in x number of days(from start) after using this plugin. It should be optional so when we need raw performance we can just turn it off.

    Thanks again for the excellent work. I tried Staticize, Staticize Reloaded. There were problems with my blog. As far as I can see your plugin is working like charm on my blog so far.

    Comment by Angsuman Chakraborty — Tuesday 21/6/2005 @ 20:34

  114. I’m running an installation of WP internally on Windows XP Pro SP2. I realize caching isn’t necessary for this environment but this is a test bed for a public blog that will run on Linux. I don’t know how to handle creating the symlink on Windows and so am getting an error when trying to access the Options page for this plugin:

    Warning: main(C:\xampp\htdocs\wp/wp-content/advanced-cache.php) [function.main]: failed to open stream: No such file or directory in C:\xampp\htdocs\wp\wp-settings.php on line 36

    Fatal error: main() [function.require]: Failed opening required ‘C:\xampp\htdocs\wp/wp-content/advanced-cache.php’ (include_path=’.;C:\xampp\php\pear\’) in C:\xampp\htdocs\wp\wp-settings.php on line 36

    Can you explain what I can do to correct this problem?

    Thanks!

    Comment by Bill Lazar — Tuesday 21/6/2005 @ 21:22

  115. I have no idea of how Windows works (does anybody konws? :-) ). Anyway, copy wp-cache-phase1.php to wp-content/advance-cache.php, it should solve the problem.

    Comment by gallir — Tuesday 21/6/2005 @ 21:38

  116. Okay, that advice cleared the previous error. However, I still get an error when trying to access the wp-cache Options page:

    Fatal error: Cannot redeclare wp_cache_add_pages() in C:\xampp\htdocs\wp\wp-content\plugins\wp-cache\wp-cache.php on line 99

    Any ideas to clear it? I’m running v2.0.5.

    Thanks.

    Comment by Bill Lazar — Tuesday 21/6/2005 @ 22:12

  117. No idea, that error was reported befoe (see one comment above), It seems to me is a PHP or installatiob bug. It is not reproductable in any of my Apache+PHP GNU/Linux servers.

    Comment by gallir — Tuesday 21/6/2005 @ 22:58

  118. I have noticed one thing that should be changed in wp cache or even as a tool in that.
    i’m getting huge loads on server even wp cache is running, but it happen only when all cached log files are deleted, because each surfer loads mysql, all log files having same similar time of expiration, and it’s about same time when all files are deleted and my server is gone. The best would be to delay each next file, not to put them on one user defined time of expiration, do you understand me ?

    Comment by miob — Wednesday 22/6/2005 @ 0:25

  119. To #118, it was this way a couple of versions before (with a random time plus expire time) but it has almost no effect because what you describe happens more often when all cache is deleted due to editing articles or new comments.

    I’ll think a better idea, perhaps waiting few hundreth of seconds between ever delete operation.

    Comment by gallir — Wednesday 22/6/2005 @ 1:17

  120. then i understand, i noticed huge loads in time when i post new articles as well,
    yeah think out something , i have a lot of traffic and can test it out.
    check out my server loads: http://vodex3.exmasters.com/hotsanic/system/load.html

    Comment by miob — Wednesday 22/6/2005 @ 12:31

  121. I’m working on it. The idea is, when a post or comment is edited/added, to delete only those files that are related, i.e. the post cache and “indexes” pages, but to keep caches of different articles.

    I’m having some difficulties because WP does not keep clearly the article ID after a post, different form’s fields must be checked.

    I hope in few day i’ll be able to release a new version with this feature.

    Comment by gallir — Wednesday 22/6/2005 @ 16:10

  122. yeah that’s the beast idea if you’re able to work it out somehow.
    i’m going on vacation, then will test it out
    thanx

    Comment by miob — Wednesday 22/6/2005 @ 16:52

  123. New version
    2005-06-19: 2.0.6
    - Delect cache _selectively_. If post_id is known
    it deletes only that cache and the general (indexes) ones.
    See: http://mnm.uib.es/gallir/wp-cache-2/#comment-4194
    - Delete cache files (all) also after moderation.

    Comment by gallir — Thursday 23/6/2005 @ 2:54

  124. I was running into the “cannot redeclare” error as others were, but I modified the wp-cache.php and now I don’t get that error anymore. This is what I did.


    function wp_cache_add_pages() {
    //add_options_page('WP-Cache Manager', 'WP-Cache', 5, __FILE__, 'wp_cache_manager');
    add_options_page('WP-Cache Manager','WP-Cache', 5, 'wp-cache/wp-cache.php', 'wp_cache_manager');
    }

    However, when I click on the WP-Cache under Options, it shows the WP-Cache Manager box but there is nothing in it. It appears as if there is a problem in the wp_cache_manager function… I’ll keep poking around…

    Comment by jeff — Thursday 23/6/2005 @ 7:22

  125. I SOLVED THE PROBLEM ON WINDOWS SERVERS…

    I don’t know if this is a good solution or not, but I simply bypassed the function call to wp_cache_check_link() in the wp-cache.php file by adding return true; right at the beginning of that function. I don’t think Windows knows what to do with the symlink commands. I simply copied wp-content/plugins/wp-cache/wp-cache-phase1.php to wp-content/advanced-cache.php and all is working. What’s the deal with needing the symlink/copy anyway?

    Comment by jeff — Thursday 23/6/2005 @ 7:34

  126. > What’s the deal with needing the symlink/copy anyway?

    Wordpress core _ejecute_ the file pointed by that link.

    Wha’s the deal with needing Windows to run PHP/MySQL/Wordpress anyway? :-)

    Comment by gallir — Thursday 23/6/2005 @ 10:01

  127. New version

    2005-06-23: 2.0.7
    - Add an extra control to make sure meta_mtime >= content_mtime
    (it could serves incomplete html because other process is re-generating
    content file and the meta file is the previous one).

    Comment by gallir — Thursday 23/6/2005 @ 16:15

  128. Referers, downtime and caching

    As you may have noticed the site has been down for a few weeks now. While it’s an eternity on the internet it flies by in realtime, especially when you’ve got so many other balls in the air. To make a long story shorter…

    A few weeks ago I notice…

    Trackback by Ben's Blog — Saturday 25/6/2005 @ 5:07

  129. Gallir, nice plugin. I just switched from Staticize Reloaded to WP-Cache. I am experiencing some problems however. When loading cached versions of a page, I get all these Fatal error: Call to undefined function: some_plugin_function() in /var/www/html/wp-content/cache/wp-cache-c573e5fc863c4ccc30f8c340501f124c.html on line 148 type of things, in which some_plugin_function() is of course a function from an active plugin. WTF? Is this a wp-cache-phase1.php vs. wp-cache-phase2.php issue? Any ideas?

    Comment by Mathias Bynens — Monday 27/6/2005 @ 9:48

  130. You cannot call any plugin’s function from WP-Cache. They are not execute. If you want to do complex things, “mclude” a file with all the necessary functions.

    Comment by gallir — Monday 27/6/2005 @ 15:36

  131. Will this ever be implemented in WP-Cache? Stuff like this works in Staticize Reloaded… Why not include the plugin files and the my-hacks.php file before sending the cached output? :(

    Comment by Mathias Bynens — Monday 27/6/2005 @ 18:18

  132. No.

    Obviously because you will lose the main wp-cache advantage (and leiv motif): speed, throughput and responsiveness similar to those of static files.

    If you want to do it, include it from you “mcluded” file, no problem. But don’t expect the same speed.

    Comment by gallir — Monday 27/6/2005 @ 18:27

  133. At a time, wp-cache deleted the entire cache when i edited a page. this no longer works. how come?

    Comment by Denis de Bernardy — Thursday 30/6/2005 @ 12:32

  134. That’s normal and it shows that wp-cache works. Look at #123 (http://mnm.uib.es/gallir/wp-cache-2/#comment-4209). It only deletes the article’s cache and all “indexes” pages, those that can change when a post is edited/added.

    Comment by gallir — Thursday 30/6/2005 @ 13:38

  135. Aye, except that wp-cache no longer works with two of my favorite plugins:

    http://www.semiologic.com/projects/sidebar-tile/
    http://www.semiologic.com/projects/smart-link/

    Comment by Denis de Bernardy — Thursday 30/6/2005 @ 21:22

  136. might the fix involve something like doing:

    uncomment in function `wp_cache_post_change($id)`:

    //wp_cache_phase2_clean_cache($file_prefix, get_query_var(’p'));

    comment everything thereafter until:

    wp_cache_writers_exit();
    return $id;

    ?
    ?

    Comment by Denis de Bernardy — Thursday 30/6/2005 @ 21:26

  137. actually, `wp_cache_writers_exit();` gets commented as well.

    Comment by Denis de Bernardy — Thursday 30/6/2005 @ 21:30

  138. I does make sense at least the plugins do something weird (and wrong) with global variables tha identifies posts’ ID.

    Comment by gallir — Thursday 30/6/2005 @ 21:56

  139. Denis, performing a simple do_action('edit_comment'); will clear all cache files. Hope this helps you.

    Comment by Mathias Bynens — Saturday 2/7/2005 @ 16:36

  140. Hello,
    I started with Wp-cache 1.5 it was fantastic.
    yesterday I updated to 2.0.7 it’s even better !
    Congratulations for this dam useful work

    Comment by Luc — Tuesday 5/7/2005 @ 12:04

  141. MayDay !

    I suddently had a problem (without changing anything)
    The relase 2.0 worked like a charm until this afternoon where i got the following error
    Warning: main(/foo/bar/www/blog/wp-content/advanced-cache.php): failed to open stream: No such file or directory in /foo/bar/www/blog/wp-settings.php on line 36

    Fatal error: main(): Failed opening required ‘/foo/bar/www/blog/wp-content/advanced-cache.php’ (include_path=’.:/usr/local/lib/php’) in /foo/bar/www/blog/wp-settings.php on line 36

    The alias do exist.
    I tried to unset the cache, deactivate the plug in and delete wp-cache-config.php then reactivate the whole.. same result.

    I tried to delete the alias to advanced-cache.php but I have a “permission refused” from the ftp server.

    I now run without cache and will be in a real difficult situation (I have a high load weblog).
    I can’t roll back to the version 1.5 ythat I used for months without any problem because the alais problem..

    Any idea ?

    Comment by Luc — Tuesday 5/7/2005 @ 18:51

  142. > I tried to delete the alias to advanced-cache.php but I have a “permission refused” from the ftp server.

    it seems to me that you have some permission problems in the php files. Check the web server can read the plugin scripts.

    Comment by gallir — Tuesday 5/7/2005 @ 23:52

  143. Hey it’s me again, i thing it’s much better now if it doesn’t delete whole cache after any edit but i’d appreciate one switch in cache admin, turn of and on deleting cache, let’s say i’m adding about 5 hours new posts, and every time it’s overloaded due to high load on server, i’m adding new articles into future, and it has no effect on the current status of site, but it every time delete all files, that would help me a lot, check out my server loads http://vodex3.exmasters.com/hotsanic/system/load.html
    will appreciate it very much, cuz i’m ill of it.

    miob

    Comment by miob — Wednesday 6/7/2005 @ 23:53

  144. Version 2.0.7 only deletes files related to the edited posts, the post itself, index and category files.

    Do you mean that posts for the futures force deletion of those files and this generates high load? Strange, because few pages have to be re-generated.

    Is this really the case?

    Comment by gallir — Thursday 7/7/2005 @ 3:02

  145. probably yes, i have no problem when posting into draft, even i think future posts are okay, but when i edit time of post it’s gonna crash. but i have to check whether it delete all files or only related posts.

    other then that it’s fine.

    Comment by miob — Thursday 7/7/2005 @ 13:53

  146. right now, i’m posting only future posts, and sometimes it doesn’t delete nothing, sometimes i see deleted all files and that’s the issue cuz it get hi loads on server.

    Comment by miob — Thursday 7/7/2005 @ 18:00

  147. It’s nice that 2.0.7 fixes the race condition that leads to incomplete HTML being generated–I saw that happen a few times on my frontpage, which I must say, did not make me happy. You may also want to think about adding a check to make sure that the cached file is at minimum n characters..

    Comment by Elliott Back — Saturday 9/7/2005 @ 7:16

  148. Checking for a minimun size (> 0 is already checked) gives no extra security. Furthermore, some most of the “white html” pages did have html headers and styles.

    Comment by gallir — Saturday 9/7/2005 @ 13:20

  149. Ricardo, you are absolutely correct if:

    You assume that WP-Cache will always work flawelessly

    Having a min-size check would have ameliorated the issue in 2.0.6, which would of course still need to be fixed. It’s just a check against accidental errors…

    Comment by Elliott Bäck — Sunday 10/7/2005 @ 7:16

  150. If wp-cache still have any race condition, I have to solve it, but you are no clear, did you find any problem in last version? Are you sure is wp-cache?

    Checking for minimun size is not the solution, doing the right concurrency control is the right one. Indeed, what’s the minimun size? 10? 100? 1000?

    Comment by gallir — Sunday 10/7/2005 @ 10:58

  151. Wonderful plugin! However one big problem.
    I too have faced the blank page issue and it is very bad for my site’s reputation :(

    Checking the minimum size of the file is not the right solution, I agree.
    How about including a comment in the footer and checking for the existence of that comment?
    That will cleanly ensure that incomplete files are not cached.
    You may think that fixing the defects will ensure that incomplete files are not generated, however you can never be 100% sure. The above will ensure only proper pages are cached.

    What do you think?

    Comment by Angsuman Chakraborty — Monday 11/7/2005 @ 14:47

  152. Thios blank page occurs with version 2.0.7? If so I think it’s not a problem of wp-cache but a wp, php or mysql one.

    And yes, I thought to add a check for at least “” before storing any page, so we can avoid these problems. I have to check that

    It would very nice if someone having this problem checks for the cached file (by means of the wp-cache administration’s page) and send to the content to me. I’m not able to reproduce it.

    If there is no one rejecting the idea, version 2.0.8 will check that AND are present before storing in cache. Although they cannot avoid all problems at least we can detect aborted scripts or falied mysql connections.

    Comment by gallir — Monday 11/7/2005 @ 14:55

  153. New version: 2.0.8

    - Add paranoic control to make sure it only caches files with closing “body” and “html” tags.

    Comment by gallir — Tuesday 12/7/2005 @ 3:08

  154. Getting WP-Cache to Work

    WP-Cache is a caching / load balancing plugin for wordpress that takes dynamic pages and staticizes them. It’s based of Matt’s Staticize and Staticize Reloaded series of plugins, and allows you to include dynamic content in the cached tem…

    Trackback by Elliott Back — Tuesday 12/7/2005 @ 10:46

  155. Just installed v2.0.8 and it works great. Thanks!

    Comment by insanum — Tuesday 12/7/2005 @ 22:06

  156. Does it still read version 2.0.4 in the Mange Plugin page? I went through the manual install for 2.0.8, but nothing seems to have changed.

    Thanks for the great work!

    Comment by Faisal — Wednesday 13/7/2005 @ 1:57

  157. Nice caching plugin, should save me considerable grief from my hosting provider.

    One thing that didn’t work according to my expectations was the entire cache was getting cleared when a comment was approved from the moderation page. As I prefer more aggressive caching, especially since I tend to get 20-30 comments a day, I came up with a workaround.

    I created a new version of the wp_cache_post_change() function called wp_cache_post_change_scs() (scs for wp_set_comment_status) that’s used as the filter for the wp_set_comment_status() function. It uses the comment ID passed in and fetches commentdata to grab the post ID. Anyhow, if anyone’s interested it’s available here for as long as the pastebin stores it.

    Comment by ColdForged — Friday 15/7/2005 @ 15:38

  158. It seems to me that you are running an old version, because last version already does what you want. If it does not work might be a WP bug (or a least an inconsistency).

    See function wp_cache_post_id().

    Comment by gallir — Saturday 16/7/2005 @ 23:52

  159. I’m running 2.0.8. I notice your blog doesn’t appear to have moderation turned on. Try editing a comment, setting the status to be “moderated”, saving it, then editing it again and set it to be approved. Then check the status of your cache.

    I saw wp_cache_post_id(). It relies on one of the globals, either $post_ID or $comment_post_ID. Neither of those are set in the moderation case.

    Comment by ColdForged — Sunday 17/7/2005 @ 0:01

  160. > I’m running 2.0.8. I notice your blog doesn’t appear to have moderation
    > turned on. Try editing a comment, setting the status to be “moderated”,
    > saving it, then editing it again and set it to be approved. Then check
    ^^^^^^^
    Sure?

    > the status of your cache.
    >
    > I saw wp_cache_post_id(). It relies on one of the globals, either
    > $post_ID or $comment_post_ID. Neither of those are set in the
    > moderation case.

    But you are using it:

    $post_id = $comment[’comment_post_ID’];

    and WP does not define when you do it from the “queue” although it does for other cases, if you do it from “edit comment” it works (I’m testing it in my development server, which is not the public one).

    I must find a better and general way to solve this specific case without duplicating code and functions.

    Any better idea?

    Comment by gallir — Sunday 17/7/2005 @ 0:52

  161. >Sure?

    Positive. Once you save the comment as “approved” (in other words, the second time) the cache is completely cleared. I wouldn’t have looked for a workaround or the reason if it had worked as expected.

    >But you are using it:
    >
    >$post_id = $comment[’comment_post_ID’];

    I’m using what, $comment? I defined comment locally as “$comment = get_commentdata($id, 1, true);” where it’s a row from the database. That’s very different.

    >I must find a better and general way to solve this specific case without
    >duplicating code and functions.
    >
    >Any better idea?

    Were I to refactor it, I’d likely pull everything that deals with getting the post ID out of that function. Here’s a pastebin for the complete file.

    Comment by ColdForged — Sunday 17/7/2005 @ 3:35

  162. New version: 2.0.9

    - Better control of post_id and comment_id by refactoring the code
    (inspired by a Brian Dupuis patch).
    - Avoid cleaning cache twice due to WP bugs that wrongly calls two actions.

    Comment by gallir — Tuesday 19/7/2005 @ 3:08

  163. New version: 2.0.10

    - Check also for feeds’ closing tags
    (patch from Daniel Westermann-Clark )

    Comment by gallir — Tuesday 19/7/2005 @ 19:53

  164. Nice! That’s an excellent bit of refactoring. Very smart to break the filters out into different calls based on what is received. Bravo!

    Comment by ColdForged — Tuesday 19/7/2005 @ 21:16

  165. Ricardo,
    I’ve raised a ticket on trac to allow non-local dynamic includes. i.e. to allow an include from a different server.
    see http://dev.wp-plugins.org/ticket/226

    Comment by Mike Little — Thursday 21/7/2005 @ 11:14

  166. New version 2.0.11
    - Check also for Last-Modified headers. Last WP version (1.5.3) does not
    it.

    - Move the previous check to the ob_callback, so the aditional headers
    can be sent also when cache still does not exist.

    Comment by gallir — Thursday 21/7/2005 @ 12:59

  167. New version 2.0.12

    2005-07-26: 2.0.12
    - Patch from James (http://shreddies.org/) to delete individual cache files

    Comment by gallir — Tuesday 26/7/2005 @ 23:49

  168. It seems with caching turned on, all pages are returned as text/html. This is not very useful for the RSS/Atom feeds, which are invalid with that MIME type. I spent many hours messing with the web server configuration and mod_rewrite, thinking it was the rewrite config that was broken…

    This is rather sad because I think the syndication feeds are probably going to be the most accessed pages of my site.

    Comment by Nicholas Riley — Saturday 30/7/2005 @ 10:48

  169. No, wp-cache returns the same header that apache/WP do. You have some problem with Apache or PHP4 keeping apache headers (I know also last WP version does no send all the right headers, don’t know why).

    Comment by gallir — Saturday 30/7/2005 @ 10:53

  170. I have found one reference to an Apache/mod_rewrite bug (http://lists.debian.org/debian-apache/2003/04/msg00019.html). But when I disable WP-Cache (on these pages in particular, I can leave it running for everything else), the correct headers are sent.

    So, regardless of whether it is actually WP-Cache’s fault, turning it off makes the problem go away. Oh well…

    Comment by Nicholas Riley — Saturday 30/7/2005 @ 11:00

  171. What’s failing in your case is the function apache_response_headers() that does not return them. Apache or PHP4 bug.

    Comment by gallir — Saturday 30/7/2005 @ 11:08

  172. I just wanted to let you know that WP-Cache performed admirably under a barrage of slashdot users today. Thank you!

    Comment by IO ERROR — Sunday 31/7/2005 @ 1:19

  173. I’m having a problem with sem_get. On every page, I’m greeted with this error:

    Warning: Wrong parameter count for sem_get() in /var/www/cvillenews.com/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 81

    Line 81 is just fine. It reads:

    $mutex = sem_get($sem_id, 1, 0644 | IPC_CREAT, 1);

    I see nothing here that ought to be generating this error. I’ve tried prefixing sem_get with @ to suppress the error, but then no pages will load.

    Several of my websites have become very popular, and my server is crumbling under the load. Any guidance that you could provide would be wonderful.

    Comment by Waldo Jaquith — Saturday 27/8/2005 @ 3:00

  174. I don’t know which server do you use and what modules it loads. Try what I explained in comment #29.

    Comment by gallir — Saturday 27/8/2005 @ 4:34

  175. I changed $use_flock to ‘false,’ as you advised. It fixed the problem with semaphores, thankfully, but now WP-Cache doesn’t do anything at all.

    The footer of the source of each page bears no indication of being statically generated, though WP-Cache is appending the time it took to generate each page dynamically. The second time that any page is loaded, it comes up blank — an empty file is being sent to the browser. WP-Cache is writing cache files (which I’ve verified by viewing the contents of cache directory), but apparently not reading them. The wp-content and cache folders are both readable by the web server (verified by loading the cache files directly in my browser).

    I’m running a stock PHP RPM on a Red Hat 9 server. It’s PHP 4.2.2, compiled with TTF, GDB, GetText, ncurses, GMP, iconv, PNG, OpenSSL, pspell, XML, zlib, BCMath, exif, FTP, SysVSem, SysVSHM, PEAR, IMAP, IMAP-SSL, Kerberos, LDAP, MySQL, PostgreSQL, SNMP, ODBC, BCMath, Calendar, DBX, Dio, Mcal, and APXS2.

    I have been a PHP/MySQL developer since 1999. I’m happy to do any sort of debugging that you’d like me to do on this problem, should it be useful to you or others.

    Comment by Waldo Jaquith — Saturday 27/8/2005 @ 6:09

  176. I can imagine where is the problem (your PHP is old). Look (and post) at the the content of the *.meta files and the files’ creation time.

    Comment by gallir — Saturday 27/8/2005 @ 13:02

  177. I can imagine where is the problem (your PHP is old).

    While it’s not the latest 4.X version, I’m not aware of any changes in PHP between 4.2.2 and 4.3.11 that should lead to

    Look (and post) at the the content of the *.meta files and the files? creation time.

    I just enabled WP-Cache, loaded a couple of files, and disabled it again, in which time two cache files were created, all with the same creation time of 10:32pm EST. The contents of the two *.meta files are:

    O:9:”cachemeta”:4:{s:7:”dynamic”;b:1;s:7:”headers”;a:0:{}s:3:”uri”;s:1:”/”;s:4:”post”;i:0;}

    and:

    O:9:”cachemeta”:4:{s:7:”dynamic”;b:1;s:7:”headers”;a:0:{}s:3:”uri”;s:43:”/2005/08/27/fire-at-badger-fire-protection/”;s:4:”post”;s:4:”1305″;}

    Comment by Waldo Jaquith — Sunday 28/8/2005 @ 4:45

  178. > While it’s not the latest 4.X version, I’m not aware of any changes in PHP between 4.2.2 and 4.3.11 that should lead to

    apache_response_headers

    Besides the lack of headers information, it seems to be OK. If it does not return any data, check if removing @ of “@file_get_contents($meta_pathname)” and “if(!@readfile ($cache_file))” in wp-cache-phase2.php shows more info.

    One of those two functions is not working in your PHP. I recommend you to upgrade PHP.

    Comment by gallir — Sunday 28/8/2005 @ 12:09

  179. You nailed it, Domingo. I completely forgot that file_get_contents() was a 4.3 addition. The exclusion of that command perfectly explains why the second pageview would come up blank. I’ll just write a workaround for this version until I can upgrade PHP. (I’m caught in Dependency Hell right now. :)

    Thanks for your help — I appreciate it.

    Comment by Waldo Jaquith — Sunday 28/8/2005 @ 19:13

  180. Problems in comments #18 #32 #64 are back. I was running wp-cache 2.0.7 and decided to upgrade to lastest version ( 2.0.12 ) and weird characters appeared again. You fixed it on version 2.0.2b … any chance to fix this Content-Type/charset problem?

    Thanks

    Comment by Toni — Monday 29/8/2005 @ 8:36

  181. It is fixed, you have some other problem. Please post one .meta file.

    Comment by gallir — Monday 29/8/2005 @ 12:07

  182. Here one meta file:
    O:9:”cachemeta”:4:{s:7:”dynamic”;b:0;s:7:”headers”;a:0:{}s:3:”uri”;s:76:”/noticias/accion/programa-de-actividades/”;s:4:”post”;s:3:”186″;}

    Comment by Toni — Tuesday 30/8/2005 @ 8:22

  183. Toni, it seems you have the same problems as #177 (your headers are not being retrieved from apache, old PHP?). Look at his real problem in #179.

    Comment by gallir — Tuesday 30/8/2005 @ 10:35

  184. You are right … but my host does not upgrade php ..they just patch it ( I think they use RHE rpm’s ). What I don’t understand is why the old wp-cache version I was using worked ( wp-cache 2.0.7 ) without these issues with the same php version.

    Comment by Toni — Tuesday 30/8/2005 @ 11:00

  185. Perhaps the problem might reside on a PHP upgrade or some change in the configuration. To be sure, can you test the old working version again? Can you post a .meta file of the working version?

    Comment by gallir — Tuesday 30/8/2005 @ 11:19

  186. El efecto Barrapunto

    Probablemente una de las cosas que más temen los administradores de un sitio web, especialmente si es automantenido, es el llamado efecto Barrapunto (o Slashdot Effect). Básicamente consiste en una saturación total del sitio web debido a una avalan…

    Trackback by El Laboratorio del Dr. Yuri — Wednesday 31/8/2005 @ 0:05

  187. to #185 … I put back wp-cache 2.0.7 and it works. See here the meta file … content-type header is there:
    O:9:”cachemeta”:4:{s:7:”dynamic”;b:0;s:7:”headers”;a:1:{i:0;s:41:”Content-Type: text/html; charset=”UTF-8″
    “;}s:3:”uri”;s:10:”/noticias/”;s:4:”post”;i:0;}

    Comment by Toni — Wednesday 31/8/2005 @ 8:24

  188. Please try 2.0.12a, perhaps a plugin or configuration is messing the output buffer http://mnm.uib.es/gallir/wp-content/wp-cache-2-0-12a.zip

    If this does work, certainly the above is the problem.

    Comment by gallir — Friday 2/9/2005 @ 18:42

  189. I have installed 2.0.12a and using the file wp-cache-phase2-new.php it works correctly. Many thanks Ricardo!!!. With wp-cache-phase2.php I get same weirs characters.

    Comment by Toni — Tuesday 6/9/2005 @ 8:43

  190. ¿Ricardo: alguna idea de por qué al activar el wp-cache el WordPress Mobile Edition deja de funcionar? Tengo la versión 2.0.12. Mil gracias.

    Comment by Eduardo Arcos — Tuesday 6/9/2005 @ 23:08

  191. ¿Qué error te da? No has probado por las dudas el 12a indicado en el #188? (así puedo confirmar que funciona o no mejor para todos).

    Comment by gallir — Tuesday 6/9/2005 @ 23:36

  192. Voy a instalarlo y te aviso, mil gracias :-)

    Comment by Eduardo Arcos — Tuesday 6/9/2005 @ 23:45

  193. Ricardo, la 12a tampoco corrige el problema. Cuando instalas el WordPress Mobile Edition hace una redirección a una página light para dispositivos móviles en el momento en que entras al blog. Por ejemplo si entras con el PSP, o con un celular.

    Cuando desactivo el cache la redirección funciona sin problemas, pero si lo activo esta deja de funcionar. Me aseguré de no tener una sola página cacheada antes de iniciar las pruebas.

    Gracias!

    Comment by Eduardo Arcos — Wednesday 7/9/2005 @ 11:52

  194. Ya lo miraré (tendré que mirar que hace el plugin), me ayudarías si me puedes adjuntar las cabeceras que envía hacia el dispositivo. ¿Sabes como hacerlo con el wget por ejemplo? (indicando el “user agent”).

    Comment by gallir — Wednesday 7/9/2005 @ 16:36

  195. 2.0.13 released.

    Changelog:

    2005-09-08: 2.0.13
    - Move request for Apache response headers to the shutdown callback
    It seems some plugins do dirty things with headers… or php config?

    Comment by gallir — Friday 9/9/2005 @ 0:26

  196. When I attempt to use the mfunc syntax on one of my sites I get an error on the page explaining that the function does not exist. The function is in a custom plugin that I’m using. Any ideas?

    Comment by Nick — Saturday 10/9/2005 @ 18:40

  197. You cannot call any WP or WP’s plugin function because they are not available when serving directly from cache: those PHP files were not read at all.

    Comment by gallir — Saturday 10/9/2005 @ 19:20

  198. So then what is the purpose of mfunc if you can’t call any functions? Is there a way it can be done?

    Comment by Nick — Saturday 10/9/2005 @ 19:34

  199. To call php functions and/or include your own functions and php files.

    What you cannot assume is that all wp functions are avaiable.

    Comment by gallir — Saturday 10/9/2005 @ 19:50

  200. And there isn’t a way to be able to do it?

    I love the plugin by the way and have been using it for quite some time. I guess I just misunderstood that part of it.

    Comment by Nick — Saturday 10/9/2005 @ 19:59

  201. You can call whatever function you want if you include the corresponding php files in your file. You must use “mclude” syntax.

    Remember that the goal of wp-cache is efficiency, including (and hence compling and executing) php files takes a considerable time. For this reason WP is relatively slow and does not scale to more than a few concurrent requests. Wp-cache advantage is that avoids all those expensive steps.

    Comment by gallir — Sunday 11/9/2005 @ 2:02

  202. New release 2.0.14

    - Add array() to headers to avoid PHP warnings

    Comment by gallir — Monday 12/9/2005 @ 2:51

  203. Hola!
    Luego de activar el plugin, e ir a Options/WP-Cache me sale el error:
    Fatal error: Cannot redeclare wp_cache_add_pages() in D:\where\ever\your\dammn\server\is\htdocs\wp-content\plugins\wp-cache\wp-cache.php on line 36

    (he borrado el changelog)

    function wp_cache_add_pages() {
    add_options_page(’WP-Cache Manager’, ‘WP-Cache’, 5, __FILE__, ‘wp_cache_manager’);
    }

    La verdad es que no se qué puede ser. Tienes alguna idea?

    Un saludo
    Alejandro

    Comment by Alejandro — Saturday 1/10/2005 @ 21:15

  204. Estás usando Windows por lo que veo, yo no lo soporto para nada. Pero mira el #124 y #125.

    Comment by gallir — Saturday 1/10/2005 @ 21:41

  205. I still get the problem with weird characters (namely, UTF-8 encoded characters considered as ISO-Latin1 or Windows Latin 1) with version 2.0.14.
    First, it happens on IE6 (windows) and Safari (Mac), Firefox seems to be OK on both systems.
    Second, I force the server to display UTF-8 instead of ISO 8859-1 by adding a line in a .htaccess file: AddDefaultCharset UTF-8 (there are other ways to do it, I tried with the smae results). But, I still get the problem.
    Third, I notice that it only happens for the Front Page and for Pages, not for Articles. Articles are OK, Front Page and Pages get this problem.
    Really strange. Do you have a clue?

    Comment by Ralph — Saturday 15/10/2005 @ 23:40

  206. Please, see #187 and show me the same file. It seems to me that wp and apache are configured to different charsets.

    Comment by gallir — Sunday 16/10/2005 @ 1:35

  207. All .meta files are OK. I checked, everything is in UTF-8:
    O:9:”cachemeta”:4:{s:7:”dynamic”;b:0;s:7:”headers”;a:1:{i:0;s:41:”Content-Type: text/html; charset=”UTF-8″
    “;}s:3:”uri”;s:49:”/davidovits/11/the-scientist-and-the-sacred-texts”;s:4:”post”;s:2:”11″;}

    After deleting wp-cache, installing it again, putting the “AddDefaultCharset UTF-8″ line in a .htaccess file, it seems to be better wiht Safari (Mac) and Firefox. However, I still have the problem with weird characters with IE6. It only happens with the front page and with Pages, not with articles. I have IE6 on WinMe. Is it better with XP?

    Comment by Ralph — Sunday 16/10/2005 @ 3:40

  208. According to the files in the .meta file, your Wordpress is configured to work with UTF-8 (the default). According to your previous comment, your apache was previously sending the ISO8859-1, which could confuse to the browser. That’s to say that the text in the database might be stored with the wrong charset.

    But it’s strange the only occurs with “index pages” and not with individual articles. Probably WP is not sending any charset encoding in those cases. You should check all .meta files to see the difference and/or the headers that are sent to the browser (It’s not a good idea to “force” the charset in Apache, I saw others have the same problem, which apache are you using? Which platform?).

    Regarding XP and/or Safari, I don’t use Windows, nor Mac OSX (I use only free software :-)).

    Comment by gallir — Sunday 16/10/2005 @ 4:50

  209. My provider uses an Apache 1.3.33 on Linux, and serves by default at ISO 8859-1. So, I don’t master anything on the server side.
    In fact I asked my brother to test on XP with Mozilla 1.7 and IE6 without touching to any settings. On both, the characters are not interpreted as UTF-8. So, it is worth than I thought. Without wp-cache, it is fine.
    Here is a meta of a page:
    O:9:”cachemeta”:4:{s:7:”dynamic”;b:0;s:7:”headers”;a:1:{i:0;s:41:”Content-Type: text/html; charset=”UTF-8″
    “;}s:3:”uri”;s:22:”/davidovits/biography/”;s:4:”post”;s:1:”3″;}

    Here is a meta of an article:
    O:9:”cachemeta”:4:{s:7:”dynamic”;b:0;s:7:”headers”;a:1:{i:0;s:41:”Content-Type: text/html; charset=”UTF-8″
    “;}s:3:”uri”;s:39:”/davidovits/6/milestones-in-geopolymers”;s:4:”post”;s:1:”6″;}

    Access to the PHP config of my provider: http://60gp.ovh.net/test.php

    The page: www.davidovits.info

    Hope this help…

    Comment by Ralph — Sunday 16/10/2005 @ 12:20

  210. I found the problem in your web. Please check the “meta” tag in the generated html. You will find in your pages:

    http-equiv=”Content-Type” content=”text/html; charset=UTF-8″

    But this is wrong, and confuses badly to some browsers. It should be:

    http-equiv=”Content-Type” content=”text/html; charset=UTF-8″

    I don’t know if you modified WP code, static templates or it’s a WP bug.

    Comment by gallir — Sunday 16/10/2005 @ 13:15

  211. New realease 2.0.15

    - Changed “Content-Size” to “Content-Length”. Obvious bug.

    Comment by gallir — Sunday 16/10/2005 @ 14:05

  212. Oh, it is a bug with Blix theme !!! So, I edit head.php to match the correct value. I think you are right.
    In Blix theme, it is written: meta http-equiv=”Content-Type” content=”UTF-8” instead of what you suggested.
    So, I take what it is written in the header.php file (line 5) of the Default theme, and paste it to the Blix theme. I will test it thouroughly and tell you if it is fine. Thanks.

    Comment by Ralph — Sunday 16/10/2005 @ 15:52

  213. Hi, is the compatibility problem with theme-switcher resolved?

    I’ve installed both WP-Cache and Theme-Switcher (http://dev.wp-plugins.org/wiki/ThemeSwitcher). When they are both activated, the server gives me the previous theme (or something rather unpredictable) when processing URLs with the theme selection parameter:
    http://SiteName/index.php?wptheme=THEMENAME
    When processing inner pages with no wptheme parameter (eg. http://SiteName/archives/cat/article-slurt/), the server always sends me the default theme.

    I noticed that there were some discussions about this issue in the previous comments. Is this problem resolved?
    Thanks! :)

    Comment by epicure — Monday 17/10/2005 @ 5:52

  214. Huum.. I just took a look to the plugin, it uses cookies to store the selected plugin. Wp-cache takes them in account but only if they have the word “wordpress” in the name, which is not true for the plugin.

    So, rename the cookie in the plugin from “wptheme” to something like “wordpresstheme”, or change function wp_cache_get_cookies_values in wp-cache.

    Note: I cannot add all plugins’cookie names in the “official” wp-cache, it will be just too large and chaotic.

    Comment by gallir — Monday 17/10/2005 @ 10:38

  215. I changed the function wp_cache_get_cookies_values() in wp-cache-phase1.php (line 66) from
    if (preg_match(”/^wordpress|^comment_author_email_/”, $key)) {
    to
    if (preg_match(”/^wordpress|^wptheme|^comment_author_email_/”, $key)) {
    and now it seems to be working fine.

    Thank you! :)

    Comment by epicure — Tuesday 18/10/2005 @ 4:09

  216. I’ve had to back-out to 2.0.14 (thank you for keeping the old versions around).

    With 2.0.15, one of my pages (http://www.sunhelp.org/review-hardware-u20/) is fine on the first load, but on reload (e.g., hitting cache) it comes up blank. Disable wp-cache, everything’s fine. After I backed out to 2.0.14, everything works fine (as it always has).

    WP 1.5.2, Apache 2.0.55, PHP 4.4.0, on Solaris 9. I’m also running Turck MMCache for PHP, but it doesn’t affect this issue - I tried with it both enabled and disabled. This is definitely a 2.0.15 problem.

    Comment by Bill Bradford — Thursday 20/10/2005 @ 4:40

  217. I saw the problem in your page, content-legth is set to zero. Subtle but stupid bug, please try version 2.0.16 which was just uploaded.

    Thanks for the report.

    Comment by gallir — Thursday 20/10/2005 @ 11:09

  218. I’m still seeing the same problem (or just a page of garbage) with 2.0.16. Backed out to .14, and its fine. Let me know if there’s anything else I can do to help test.

    Comment by Bill Bradford — Thursday 20/10/2005 @ 19:17

  219. It seems PHp on solaris have a different behaviour. In fact I could just don’t add any content-length header. It’s only to be more polite with browser, because WP does not send it.

    So, what you are sufffering is a bad content-legth value because ob_content_length does not give the right one. Can you check what’s its value with 2.0.16? (i.e. wget -S URL).

    Comment by gallir — Thursday 20/10/2005 @ 19:24

  220. I’m not seeing *any* content-length header with either 2.0.14 or 2.0.16. Here’s output from both:

    http://www.mrbill.net/wpc/

    I’ve left the site up running 2.0.16 right now if you want to check it out.

    Comment by Bill Bradford — Thursday 20/10/2005 @ 19:32

  221. When it I hit it a second time (doh!) I’m getting this with 2.0.16:

    1 HTTP/1.1 200 OK
    2 Date: Thu, 20 Oct 2005 17:45:59 GMT
    3 Server: Apache
    4 X-Powered-By: PHP/4.4.0
    5 X-Pingback: http://www.sunhelp.org/xmlrpc.php
    6 Content-Length:
    7 Last-Modified: Thu, 20 Oct 2005 17:45:48 GMT
    8 Keep-Alive: timeout=15, max=100
    9 Connection: Keep-Alive
    10 Content-Type: text/html; charset=utf-8

    Comment by Bill Bradford — Thursday 20/10/2005 @ 19:46

  222. With 2.0.14, its spitting out a Content-Size header but not a Content-Length header:

    1 HTTP/1.1 200 OK
    2 Date: Thu, 20 Oct 2005 18:03:43 GMT
    3 Server: Apache
    4 X-Powered-By: PHP/4.4.0
    5 X-Pingback: http://www.sunhelp.org/xmlrpc.php
    6 Content-Size: 0
    7 Last-Modified: Thu, 20 Oct 2005 18:03:40 GMT
    8 Connection: close
    9 Content-Type: text/html; charset=utf-8

    Comment by Bill Bradford — Thursday 20/10/2005 @ 20:04

  223. Please try http://mnm.uib.es/gallir/wp-content/wp-cache-2-0-17-pre1.zip

    Clean cache contents just after installation to be sure it sends new data. It _must_ work :-)

    Comment by gallir — Thursday 20/10/2005 @ 21:14

  224. So far, 2.0.17pre1 looks good. I’ll let you know if I encounter any weirdness.

    Thank you! :)

    Comment by Bill Bradford — Thursday 20/10/2005 @ 23:32

  225. 2.0.16 left pages coming up blank on reload for me, too. 2.0.17pre1 also fixed the problem for me.

    Thank you for a fine piece of software, Ricardo. For the life of me, I can’t imagine why this function isn’t native to WordPress.

    Comment by Waldo Jaquith — Saturday 22/10/2005 @ 4:55

  226. New version: 2.0.17

    - Commented out Content-Lenght negotiation, some site have strange problems with
    ob_content_lenght and buffer length at OB shutdown. WP does not send it anyway.

    Comment by gallir — Sunday 23/10/2005 @ 13:58

  227. My installation didn’t work until I removed the outer folder (wp-cache 2-0-17) & uploaded only the wp-cache folder. I think it’d be worthwhile to let users know they shouldn’t install the external folder but only the one within it.

    I also noticed that the wp-cache folder was CHMODed down to “000″ which I’d noticed as a problem in the WP support forum. But I thought the plugin author said he’d fixed it there.

    Comment by Richard Silverstein — Monday 31/10/2005 @ 12:25

  228. > My installation didn’t work until I removed the outer folder (wp-cache 2-0-17) & uploaded only the wp-cache folder. I think it’d be worthwhile to let users know they shouldn’t install the external folder but only the one within it.

    Please read #1 in “Installation”. It’s is the same procedure as most WP plugins.

    > I also noticed that the wp-cache folder was CHMODed down to “000″

    It’s not a problem of wp-cache, but the umask in your Apache/php. wp-cache tries to create with all permissions:

    mkdir( $cache_path, 0777)

    which is, BTW, the default too.

    Comment by gallir — Monday 31/10/2005 @ 12:35

  229. Hello, I’ve installed WP-Cache, it is configured, but it is not working? Nothing is being created in the cache directory. I’ve chmod’d the cache directory 777 and still nothing. I have great hopes of using this plugin. Any help would be appreciated. and I will let you know if I get it working.

    Thanks!

    Comment by Jamie — Tuesday 1/11/2005 @ 17:27

  230. If you don’t give more information I can’t help you.

    Comment by gallir — Wednesday 2/11/2005 @ 11:21

  231. I finally figured it out… I had permission issues with Apache creating the advanced-cached.php softlink. But when I created it, it was chmod’d with 000. I chmod’d it correctly and now it is working great. Thank you!

    Comment by Jamie — Wednesday 2/11/2005 @ 17:02

  232. I have installed the plugin and it seems to be working. Cache files are being created.

    However, I don’t think they’re being sent. There is nothing in the html source that is new.

    What do I need to check?

    Thanks.

    Comment by the dude — Friday 4/11/2005 @ 2:29

  233. Check for wp-cache comments at the very end of the html source. Be sure to force a reload in the browser.

    Comment by gallir — Friday 4/11/2005 @ 2:33

  234. Right, I did that, refreshed pages, hard refresh, different browsers etc.

    No comments in souce (searched for “cache”)

    [added]

    I just checked the “cache contents” and only the feeds are being cached?

    “/feed/ 2445 secs 9 KB
    /?feed=rss2 2335 secs 9 KB
    /feed/”

    Comment by the dude — Friday 4/11/2005 @ 2:36

  235. So, check in “administration->options->wp-cache” what are the rejected uris and accepted files. Compare them with the URL you use in your blog. Or paste them here so i can have a clue.

    Comment by gallir — Friday 4/11/2005 @ 2:58

  236. I left them as the defaults:
    rejected:
    wp-

    accepted:
    wp-atom.php
    wp-comments-popup.php
    wp-commentsrss2.php
    wp-links-opml.php
    wp-locations.php
    wp-rdf.php
    wp-rss.php
    wp-rss2.php

    my blog is at the root so the home is .com/
    also tried different subpages, .com/archives/142 etc

    Comment by the dude — Friday 4/11/2005 @ 3:12

  237. Strange… nothing strange in “UA rejected strings”? Could be possible your browser pass thru a proxy? Could you point me to your web site to check the html?

    Comment by gallir — Friday 4/11/2005 @ 3:23

  238. UA rejected strings? You mean rejected URIs? Nope, just wp-. I deleted it and re-entered it manually, tried again. Even tried “Restore Default Configuration.” It’s caching the feed urls and nothing else.

    This is on 4 different browsers, 2 different computers, 2 different locations (home & office).

    Sure, you can take a look. The site is htdude.com.

    Comment by the dude — Friday 4/11/2005 @ 6:25

  239. You have made a wondedrful plugin. I use it in my Simple Thoughts Blog for several months and it has admirably handled the load. I prefer it over eAccelerator as wp-cache has knowledge on when to refresh the cache.

    There is one big reliability downside though. Occassionally I find some pages (including home page) are displayed blank, as in totally blank. I don’t know why it happens.
    Could it be a threading issue? For instance what happens when multiple simultaneous requests are made while the cache is being generated?

    Deleting the cache always solves the problem.

    Any idea why it happens and how to prevent it?

    Comment by Angsuman Chakraborty — Sunday 6/11/2005 @ 3:44

  240. I solved this race-conditions in previous versions (few months ago: http://dev.wp-plugins.org/changeset/2568 ). Since then I didn’t see this problem and no ones reported it again.

    Which version do you use?

    Comment by gallir — Sunday 6/11/2005 @ 3:57

  241. Nowhere on the internet can I find HOW to create a symbolic link :(

    Comment by nimd4 — Wednesday 9/11/2005 @ 5:24

  242. Some interesting benchmark that shows how powerful WP-Cache is :-)

    http://janit.iki.fi/wp-bench/

    Comment by gallir — Monday 14/11/2005 @ 14:14

  243. hi,

    i am using the ISO-8859-1 charset because i have a bunch of posts which show up with “?” instead of apostrophes or single quotes, etc when i use UTF-8. however when i enable wp-cache these characters again show up incorrectly. is there some way i can configure wp-cache to address this? i’d really like to resolve this and use wp-cache if at all possible :)

    Comment by jon — Tuesday 15/11/2005 @ 19:42

  244. It was discussed several times before, checck previous comments, especially #210 and #177.

    Comment by gallir — Tuesday 15/11/2005 @ 19:51

  245. sorry, i just noticed a previous commenter had the same problem — however i installed the 2-0-2a.zip you asked the person to test and that didn’t work either

    Comment by jon — Tuesday 15/11/2005 @ 20:00

  246. apologies once again — it is in fact working ^_^;;; thank you very much :)

    Comment by jon — Tuesday 15/11/2005 @ 20:03

  247. Just wanted to say thanks for this component! My site has just barely survived being slashdotted from The Register. The server is a puny 800mhz box that sits in my kitchen on a standard DSL line. All told, it handled just under 30,000 unique visitors in under 24 hours.

    Granted, the site is not serving quickly, but considering the load it is still getting, I’m impressed its serving at all!

    Thank you!!

    Geoffrey

    http://www.idiotabroad.com

    Comment by Geoffrey McCaleb — Wednesday 16/11/2005 @ 12:13

  248. Hi everybody,

    with a small hack, you can enable caching AND stattraqing: First the hook for caching in wp should be placed AFTER all the core files are loaded. So i moved the lines

    // For an advanced caching plugin to use, static because you would only want one
    if ( defined(’WP_CACHE’) )
    require (ABSPATH . ‘wp-content/advanced-cache.php’);

    to just above this line:

    do_action(’core_files_loaded’);

    Then, in wp-cache-phase1.php add these lines:

    include_once(’wp-content/plugins/stattraq.php’);
    add_action(’shutdown’, ’stat_traq_event’);
    do_action(’shutdown’,”);

    Alternatively you can just do the “action” yourself (stat_traq_event), but it looks so much nicer this way.

    The initialization of the parameters and classes doesn’t take long. My weblog (http://www.toomuchcookies.net) is running with this small hack and it’s F.I.N.E., have a look.

    cya. Omar

    Comment by Omar Abo-Namous — Wednesday 23/11/2005 @ 12:06

  249. Hi!

    Is it possible to make wp-cache does not cache any single_posts?
    Maybe with any “if(!is_single())”-argument?
    I have installed the wp-paginate-Plugin which makes a lot of databasetraffic in large categories and I would like to have wp-cache only for caching archives…

    In any case: This plugin is GREAT! :-)

    Bye!
    Jens

    Comment by Jens — Friday 25/11/2005 @ 15:24

  250. You can configure what not to cache (any to _all_) via substring and regular expressions. You can also configure which should be cached aven if it complies the previous rule.

    Se the wp-cache configuration page.

    Comment by gallir — Friday 25/11/2005 @ 15:27

  251. HEllo,

    I was just curios if you could modify your plugin so that it works on a sitewide basis with wpmu, I’d like to build a free blogging service andenable it for all users.

    Do you think you could tweak it that way and btw. do you think it makes sense? I’d say yes, because I expect a lot of users…

    Comment by ovidiu — Sunday 27/11/2005 @ 0:36

  252. Hi,
    I installed it, but can’t use it. I moved my site from another server, and if I use the plugin, all non-ascii letters and symbols are b0rked. I think it is connected to a utf-8/internal/external mysql database encoding issue, but I can’t solve it. Any thoughts are highly appreciated.
    regards,

    Grendel

    Comment by Grendel — Thursday 1/12/2005 @ 0:09

  253. You have a typo in your script that got me stuck for a while.

    This is where it appeared for me:

    - Install WP-Cache 2.0
    - Enable it in Plugins menu
    - Go to Options > WP Cache

    On this page I was told that WP Cache wasn’t able to edit wp-settings.php and I would need to do it manually.

    It told me to ad this string:

    define(’WP_CACHE’, true);

    Notice anything wrong?

    Ummm… there’s no space between “define” and “(” so it doesn’t work.

    I should have caught it the first time when looking at all the define statements in wp-settings.php but I didn’t.

    Added the space and everything is now good.

    Thought you’d want to know. I’ll let you know how everything else works out - looks like I’m good to go now.

    Regards,

    dave

    Comment by Dave — Saturday 3/12/2005 @ 22:40

  254. No, this is not the problem, I think no such a space was required in any modern language :-)

    Comment by gallir — Saturday 3/12/2005 @ 22:46

  255. Saludos Ricardo. Yo uso cpanel y no sé cómo hacer un “link simbólico” que se ejecute en el servidor. El archivo advance-cache.php no sé si hay que crearlo, porque sólo desempaqué el paquete y lo subí. Me interesa bastante el plugin, porque de vez en cuando linkean mi blog desde foros populares y el hosting protesta. Gracias.

    Comment by José Joaquín — Thursday 8/12/2005 @ 16:16

  256. Has anyone tried WP Cache with Wordpress 2.0? I’d like to know if it works before I try it on my live site.

    Comment by badrad — Sunday 11/12/2005 @ 8:10

  257. Neither mclude nor mfunc work on my 1.5 Strayhorn install.

    On static pages, mclude returns errors that it cannot find the file (because it’s looking in the location of wp-config, not templates), and any attempt to give it a path results in a parse error.

    Mfunc just fails–no warning, no error, just doesn’t happen.

    What’s up with that?

    Comment by Pariah S. Burke — Saturday 17/12/2005 @ 0:17

  258. Hello, I’m using wordpress 2.0-RC2 on a box with lighttpd, php 5.1.1 ( fast cgi ). I’ve installed the plugin, enabled it. The pages on the initial load come up blank, but then on the second run they load just fine. Any pointers where I might look to try and debug this issue?

    Comment by Vincent Toms — Tuesday 20/12/2005 @ 6:55

  259. Hi,
    I was trying to upgrade to WordPress 2.0 and I disabled it and deleted what you said in the config file but it showed errors something like :
    Fatal error: main(): Failed opening required ‘/homepages/25/d112340083/htdocs/blog_dir/wp-content/advanced-cache.php’ (include_path=’.:/usr/local/lib/php’) in /homepages/25/d112340083/htdocs/blog_dir/wp-settings.php on line 66

    and I not sure if that is your plug in or something else but it seems like your plug in and when I looked around it seemed to edit lots of config files and when I tyred to upgrade it gave me errors like that… How do I uninstall it? Thanks…

    Comment by Joe — Thursday 22/12/2005 @ 21:19

  260. WP-Cache does not work with WP2 (ate least that was I heard). I thought cache was already included in WP2, but it seems it doesn’t, or it does not do the same type of cache.

    So, I’m thinking to porting wp-cache to WP2.

    Comment by gallir — Friday 23/12/2005 @ 0:09

  261. WP2 includes its own caching mechanism, which is on by default. It may have a few bugs in it, though…

    Speaking of which, I need a way to execute (large?) portions of PHP code inside a cached page?

    Comment by Michael Hampton — Sunday 25/12/2005 @ 4:05

  262. I’m afraid that this post will show that I don’t understand cacheing & dynamic vs. static pgs. very well but…I installed WP-Cache & activated it. The first thing I noticed is that after editing one of my posts I could not clear my cache in order to see the changes. Is there some exception I need to list in WP-Cache settings in order to allow edited posts to display changes properly? Perhaps my posts are now considered static pgs. & should be dynamic? Again, I apologize if this betrays any ignorance on my part. But I’d be happy for any suggestions folks could have about fixing this issue.

    Comment by Richard Silverstein — Sunday 25/12/2005 @ 8:21

  263. I’ve subsequently learned some more about my problem. First, I am using Firefox 1.5 & WP 1.5.3. There are times after editing a post that I cannot see the changes even after using F5 to completely clear the cache. Usually if I wait say 30-60 mins. & THEN do a cache clear I then CAN see the editing change. But there are times when I can see my editing change immediately after making them.

    I do not have this problem when I view my blog in IE. All changes appear immediately and WITHOUT needing to clear the cache.

    So I’m wondering which one of these 3 options might be at work (or possibly something else might explain this?): either there is a built-in WP-Cache delay that at times (though not always) prevents one from clearing the cache to see such edits; or FF has a conflcit w. WP-Cache; or FF has a bug.

    Comment by Richard Silverstein — Monday 26/12/2005 @ 9:37

  264. I feel that wp-cache is messing up with my utf-8 charset… once a page is loaded from cache, all umlauts and some special chars look strange… deleting the cache fixes it again, so it has to be related with wp-cache

    Comment by CottonIJoe — Friday 30/12/2005 @ 1:38

  265. Hi, I have moved blog to the new server and now when I request some page first time I don’t see anything. I have to reload the page and then I can see it.

    Do I have to set up something? Or have to change something?

    Comment by Jan S. — Sunday 1/1/2006 @ 19:20

  266. The error i get:

    Fatal error: Cannot redeclare wp_cache_add_pages() (previously declared in x:\sites\blog\wp-content\plugins\wp-cache\wp-cache.php:150) in x:\sites\blog\wp-content\plugins\wp-cache\wp-cache.php on line 151

    Reading thru the whole of the unstructured comments here i already noticed that it is claimed that this be a windows-error and noone´s gonna support that os. this is inacceptable to me because the error-message undoubtedly is a php-message. that means, at least in my interpretation, that something has not been coded the way it should. might be that linux is more tolerant in that respect to not end up with an error, but windows does. clearly this has to do with the declaration of functions.

    and in my opinion the coder should at least see himself in the responsibility to provide a working php-solution. noone requests him to change to windows himself.

    Comment by dpetereit — Thursday 5/1/2006 @ 13:03

  267. > and in my opinion the coder should at least see himself in the responsibility to provide a working php-solution. noone requests him to change to windows himself.

    I don’t use Windows, I cannot check Windows bugs or lack of features compared to the one available in free platforms.

    Wp and Wp-cache are free software, Windows isn’t. I just program and suport free software.

    If you don’t like wp-cache, don’t use it. If you are smart enough, re-write wp-cache or send me patches. i.e. don’t whine or pretend I have obligations to you, just show me the code and solve the problems for _your_ specific platform.

    Comment by gallir — Thursday 5/1/2006 @ 13:16

  268. hello,

    do i still need this plugin in WP2, or is it allready integrated?

    thanks!!!!

    Comment by björn spiegel — Thursday 5/1/2006 @ 15:29

  269. there is a cache system in WP2, which is still no so efficient as wp-cache. the developers say it will be improved over time. i must check and learn it before continuing with wp-cache.

    Comment by gallir — Thursday 5/1/2006 @ 15:32

  270. it is sad to see that the thought of not being responsible for anything just because of giving a product away freely gains ground. i hope that the car industry will never turn to this behaviour or else i would have to cycle to work again for mere security-reasons.

    i rather pay for software than accept what you state here.

    Comment by dpetereit — Thursday 5/1/2006 @ 16:14

  271. the time you pay me for support the same you pay for your car or car services, i will give you all the support you need.

    meanwhile, you can look in your town for someone who has the knowledge, so you can pay him and solve your specific problem. slavery is illegal, you know.

    BTW,did you call Microsoft and ask them to solve the problem? did they answer you?

    PS: the problem is Windows problem, I don’t use Windows. Don’t be such a moron and at least try to help by doing some research and send me more information.

    Comment by gallir — Thursday 5/1/2006 @ 16:30

  272. I have done research as if i had never done anything else in my life already. what i found out is two possible reasons for that error:

    1. a function is being declared by the same name twice in the very php-file.
    2. a function is being declared by the same name twice, but not in the same file. The second declaration takes place in another file which has been included with the include- or require-command.

    Solution to 1: Don´t declare functions twice. (Couldn´t find that….)
    Solution to 2: Be sure noone declared your function already in another file that you include or require unless you use include_once or require_once. (Couldn´t find that either..)

    That´s all this moron is able to input.

    Comment by dpetereit — Thursday 5/1/2006 @ 17:13

  273. The function is defined just _once_, in line 150 o wp-cache. it’s a problem in your machine. or php in windows, or perpaps you got two installations of wp-cache. check the contents of your wp-content/plugins/ directory.

    at the moment it’s all this slave can do for you, sir.

    Comment by gallir — Thursday 5/1/2006 @ 17:29

  274. just don´t give in to slavery. you gotta stand up and fight! remember: all men are equal!

    Comment by dpetereit — Thursday 5/1/2006 @ 17:49

  275. touchè :-P

    Comment by gallir — Thursday 5/1/2006 @ 17:52

  276. Yeehaw!

    I thought turning on GZIP improved my speed, but, good golly almighty–My total time for page requesnts (according to GrabPERF) just went from 5.8 seconds to 0.61 seconds: 10x faster. A 100% improvement.

    Big kudos!

    Rich
    BlogRodent

    Comment by Rich Tatum — Monday 9/1/2006 @ 8:56

  277. Is there a conflict between WP-Cache and WP 2.0? I had the cache working great with WP 1.5, but after upgrading to 2.0, I can’t seem to get the WP-Cache status in the generated pages, and no cached pages are listed in the Options: WP-Cache management page.

    Any ideas or tricks?

    Comment by D'Arcy Norman — Monday 9/1/2006 @ 23:46

  278. WP2 and WP-Cache works. I wanted to write how to use it, but this site wrote to me “No one likes spam”… So if you want, contact me…

    Comment by Jan S. — Thursday 12/1/2006 @ 21:27

  279. to 278: webmaster@purebeautyblog.com

    Comment by Jan S. — Thursday 12/1/2006 @ 21:27

  280. How i can create a symbolic link??

    Comment by Juan Miguel García — Thursday 12/1/2006 @ 22:27

  281. I desperately need to make sure wordpress 2 and wp-cache works together. Can someone post how to make it work? Thanks!

    Comment by pmates — Saturday 14/1/2006 @ 22:52

  282. Not tested, AFIK ¡, it does not work.

    Comment by gallir — Sunday 15/1/2006 @ 5:05

  283. Just FYI, I had absolutely no problems with WP-Cache 2.0.17 on WordPress 2.0 until I upgraded PHP from 4.4.2 to 5.1.2. Then I started getting blank pages on the first read (not the second). This was on Linux/Apache 1.3 with MySQL 5 and mod_gzip, with compression turned off in Wordpress.

    I’ve disabled the cache for now, but I thought you could use the data point.

    Comment by Kelson — Tuesday 17/1/2006 @ 7:22

  284. Yesterday I got Wp-Cache 2.0.17 working on WP 2.0 on the following platforms - Windwows 2k with IIS 5 and Windows 2003 with IIS 6. Both run PHP 5 and MySQL 4.1. Apologies for Win but I’m at work!

    I followed the instructions with the addition of:
    - used the tip in comment 125 above,
    - gave webserver a/c modify (read/write/change) permissions to wp-content and wp-content/wp-cache directories,
    - further edited wp-cache/wp-cache.php. Line 544 on my file (it begins echo ‘

    Comment by Struan — Wednesday 18/1/2006 @ 10:40

  285. continuation of comment 284: (begins echo ‘

    Comment by Struan — Wednesday 18/1/2006 @ 10:45

  286. Sorry, hopefully this works: (begins echo

    Comment by Struan — Wednesday 18/1/2006 @ 10:50

  287. WP-Cache initially appeared to work for me in WordPress 2.0. However, after getting a link off a high-traffic site, I later discovered that it would rarely serve the cached page and 9 times out of ten was just rebuilding. The caching that has been added in Wordpress 2.0 is certainly nowhere near as efficient as Wordpress 1.5.2 with Wp-Cache, so I’ve downgraded until Ricardo has a look at it.

    Comment by Jamed Turnbull — Wednesday 18/1/2006 @ 10:50

  288. Sorry, hopefully this works!: (begins echo input type=”hidden” name=”wp_delete_cache_file”)

    I think there is an un-needed , /” in the preg_replace function.

    I now have preg_replace(”/^(.*)\.meta$/”,”$1″, $file)

    Don’t forget wp-config.php

    Works great for me as it got an underpowered server coping with a large volume of hits so thanks for creating this in the first place.

    Comment by Struan — Wednesday 18/1/2006 @ 10:53

  289. Struan, any chance you could write a post with your solution, and link from here? It looks like the code is choking the comment system…

    Comment by D'Arcy Norman — Thursday 19/1/2006 @ 21:28

  290. PHP 5 and this plugin do not play nice. I get the same blank page on initial page loads, then reload and page is fine.

    Comment by Brian Sugar — Monday 23/1/2006 @ 3:26

  291. Thanks

    I have mentioned my other sites and the various changes but some thanks and acknowledgements are needed.
    All three of my sites are running on Wordpress. Although known as blog software (and that it what it is in the default configuration) it is very ve…

    Trackback by Graeme's — Tuesday 31/1/2006 @ 11:39

  292. I report this error in someone blogs with wp-cache.

    Warning: sem_acquire(): supplied argument is not a valid SysV semphore resource in /chs/p1/blog.ferca.com/home/html/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 90

    Warning: sem_release(): supplied argument is not a valid SysV semphore resource in /chs/p1/blog.ferca.com/home/html/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 99

    Can you help me ?

    Comment by David Carrero Fdez-Baillo — Wednesday 1/2/2006 @ 13:06

  293. Pregunta, porque se ve todo en negrita? Alguien se olvidó de cerrar algun ? A ver…

    Comment by a — Wednesday 1/2/2006 @ 14:51

  294. Lo siento!

    Comment by a — Wednesday 1/2/2006 @ 14:51

  295. To fix the blank page issue modify wp_cache_ob_end() in wp-cache-phase2.php to use ob_end_flush() instead of ob_end_clean().
    Works for a setup using PHP 5.1.2, MySQL 5.0.18, WP 2.01 and WP-Cache 2.0.17.

    Comment by Jussi Vaihia — Friday 3/2/2006 @ 14:12

  296. This line in wp-cache-config.php can cause problems when things like eAccelerator or APC are turned on.

    if (!class_exists('CacheMeta')) {

    A fatal error is generated, but is hidden by @, so you just get a blank page, everywhere in your website.

    Fatal error: Internal Zend error - Missing class information for in

    Anyone who gets blank pages, remove that if() and the closing bracket

    Comment by Mark J — Monday 6/2/2006 @ 6:47

  297. Hey,

    First off I’m running wordpress 1.5.2.

    It seems this plugin does nothing. Everything seems to be installed correctly. There are zero error messages. I can access wpcahe options in admin cp fine.

    It’s just not caching any files. The cache folder is empty. Yes wpcache is enabled in admin cp.

    Cache folder is chmod 755. (if i chmod 777 if goes back to 755 automaticly) .

    There is nothing in any error logs or anything.

    Pages display fine. No time though in html saying time to build or anything.

    Well any ideas?

    Thanks,

    Will

    Comment by Will — Wednesday 8/2/2006 @ 10:33

  298. Will, Does your wp-config file have “define(’WP_CACHE’, true);” uncommented?

    Do you have the advanced cache symlink?
    /wp-content/advanced-cache.php -> /wp-content/plugins/wp-cache/wp-cache-phase1.php

    Ricardo,

    Any word on a version compatible with Wordpress 2.0? I can’t upgrade without WP-Cache!

    Comment by James Turnbull — Monday 13/2/2006 @ 13:16

  299. Hi,

    Great Plugin. Is there anyway to use it to make a static copy of the website? Basically, I want to use nothing but .html files for the news section of my website (where wp is being used) and just keep wp “hiding” in the back.
    My idea is “simple”. When WP-CACHE generates the cache, it put’s it on the main wp directory with static links from other pages there, so, instead of having a “http://www.bgoncalves.com/online/news/?p=xx” I would have something like “http://www.bgoncalves.com/online/news/post-xx.html” which would just be a static html page. Whenever I changed the theme or added new posts (comments are disabled) the static versions would be updated accordingly. The website user wouldn’t even need to know that wordpress is being used and it would remove the necessity to keep doing queries to the database to retrieve content that is static.
    Any ideas? Do you know any other plugins that would do something like this? I’ve tried searching online but WP-CACHE was the closest thing I could find.

    Gracias!

    Comment by Bruno — Thursday 16/2/2006 @ 20:01

  300. Hey, I would like to thank all of you people providing some information for using this plugin on Windows Server 2003, with MySQL, and PHP 5.

    If you guys would like to know how to setup a symbolic link with windows you can use the following command:

    fsutil hardlink create fsutil hardlink create

    Example: fsutil hardlink create c:\foo.txt c:\bar.txt

    Comment by James — Saturday 18/2/2006 @ 11:42

  301. Caching the blog

    I installed the WP-Cache2 plugin today into my blogging software. This means that browsing my blog should be much faster. This means that you can drop by my blog homepage to see what is up in a lot less time. This means that you should be able to se…

    Trackback by Jacob's Blog — Tuesday 21/2/2006 @ 7:18

  302. Caching the blog

    I installed the WP-Cache2 plugin today into my blogging software. This means that browsing my blog should be much faster. This means that you can drop by my blog homepage to see what is up in a lot less time. This means that you should be able to se…

    Trackback by Jacob's Blog — Tuesday 21/2/2006 @ 7:18

  303. Ricardo, una pregunta. La instalacion fue correcta y todo bien, sin embargo ahora a pesar de que algunas paginas están cacheadas y tardan nada en cargar, otras van superlentas, notando en general un empeoramiento en la carga. ¿Puedes ser por desactivar la compresion Gzip? ¿Ocurre algo si la activo teniendo tu plugin activado?

    un saludo!

    Comment by elsamu — Tuesday 21/2/2006 @ 14:05

  304. No, no funciona con el compresor gzip.

    El wp-cache no debería afectar negativamente –es muy poca sobrecarga– a la carga de páginas.

    Comment by gallir — Tuesday 21/2/2006 @ 14:10

  305. Installing WP-Cache on Windows

    WP-Cache is probably the most widely used caching plugin for WordPress. Unfortunately, it doesn’t support windows and numerous people failed with the installation. This article describes how to run WP-Cache on Windows.
    To install WP-Cache on Win…

    Trackback by digital bites — Friday 24/2/2006 @ 20:27

  306. I have successfuly installed wp-cache, everything seems to be working ok, except no files are getting cached.

    i checked the installation a few times and i believe everything is as it should be…

    any ideas?

    Comment by jcinacio — Monday 27/2/2006 @ 0:28

  307. Ricardo,

    I’ve put together some simple steps of installing WP-Cache on windows on my blog. I was wondering if you wouldn’t want to include this in the general distribution. I could help coding if you want. Don’t really see why it shouldn’t be supporting Windows- easy enough?

    Cheers,
    Andi

    Comment by andi — Wednesday 1/3/2006 @ 17:18

  308. So If I put index.php in the "Add here those filenames that can be cached, even if they match one of the rejected substring specified above." it will also help if my site is getting slashdotted?

    Comment by fluxiontech — Friday 3/3/2006 @ 21:51

  309. I finally figured out the problem i had with wp-cache not doing anything:

    the line "define(’WP_CACHE’, true);" was the last line in wp-config.php, and the plugin wasn’t beeing included…

    also, i chanched ob_end_clean to ob_end_flush in wp-cache-phase2.php

    now it completely ROCKS!

    thanks

    Comment by jcinacio — Sunday 5/3/2006 @ 4:04

  310. (sorry for the spam)

    For those of you who are trying to figure out what kind of speed improvement WP-Cache makes to wordpress, i must say that in my server, apache now serves the main page (index.php) about 53x faster!

    if anyone is interested on the details of the benchmark, see http://www.jcinacio.com/2006/03/05/speeding-up-wordpress-part-2

    thanks again for the good work on the plugin.

    (btw: 1 request - how about automaticly cleaning cache on new posts?)

    Comment by jcinacio — Tuesday 7/3/2006 @ 18:24

  311. Ricardo, una pregunta.

    El SPAM y el AUTOBOMBO son de LIBRE CIRCULACION?

    Gracias.
    *cough

    Comment by mx — Tuesday 7/3/2006 @ 19:26

  312. When I use wp-cache I have problems with the German Umlaute: ä,ü,ö an so on. They are displayes unredable. Gzip is disabled in the Wordpress-Installation.

    Can you give me an advise?

    Thanks.

    Comment by André Fiebig — Thursday 16/3/2006 @ 3:42

  313. Thanks for posting that fix, Viernes; I was also getting blank pages on an initial load, and then them vanishing once cached (a reverse of the problem people were posting earlier).

    Changing that little function seems to have done the trick.

    Comment by Ryan Williams — Friday 17/3/2006 @ 16:56

  314. I have a question on this… will WP-Cache2 work on a Windows/IIS server? I ask because I note that as part of the install guide there is a requirement to create a link… do I need to change anything on the install for a Windows/IIS server? Thanks in advance.

    c0y0te

    Comment by c0y0te — Tuesday 21/3/2006 @ 11:39

  315. I have just one question regarding this.

    Does this plugin work on 1.5.x ??

    Comment by Ajay D'Souza — Tuesday 21/3/2006 @ 17:42

  316. Performance Tuning von Wordpress

    In den letzten Wochen war mein Server öfter mal nahe am Anschlag und kurzfristig sogar mal darüber hinaus. Zur Entspannung der Situation liefere ich seit ein paar Wochen einige Seiten statisch aus einem Cache aus. In den folgenden Tagen werde ich ma…

    Trackback by Mein Parteibuch — Wednesday 22/3/2006 @ 13:03

  317. Hi. I am using WP-Cache with Wordpress 2.0. It works great, but my host is complaining because it creates thousands of empty tmpXXXXXX files in the wp-content/cache directory structure. Have you heard of this before? How can I fix it?

    Thanks.

    Comment by Jon — Wednesday 22/3/2006 @ 20:18

  318. Hi, Ricardo. Is there any reason the plugin would need write-access to the wp-content-directory once the config file exists and is writable for the webserver?
    I’ve just changed line 430 to <code>if ( !file_exists($wp_cache_config_file) && !is_writable($dir)) {</code> and it does not seem to have any ill effects.

    Comment by Joerg — Friday 24/3/2006 @ 22:32

  319. Just installed it on my blog. Works great, thanks!

    Comment by NiElS — Sunday 26/3/2006 @ 12:46

  320. I installed it on my website and it didn’t give me any error message. Installation was successful, but it does not work. It does not even give me a hint that it isn’t working. Any clues?

    Comment by Abs — Tuesday 28/3/2006 @ 21:34

  321. Best cache plugin for Wordpress

    If (for some performance reason) you’re looking for some solution to speed up your Wordpress performance (or low down your CPU usage) you can try WP-Cache plugin.

    Trackback by Some usefull IT tips — Thursday 30/3/2006 @ 18:15

  322. A lot of traffic, but still strong with WP-Cache

    genericface made it on Lifehacker today, but thankfully I’m using WP-Cache 2.0.

    Trackback by genericface blog — Friday 31/3/2006 @ 1:30

  323. xxx.xxx.xxx.xxx - - [30/Mar/2006:23:15:24 -0500] "GET / HTTP/1.1" 200 6253 gzip: On, WP-Cache: off
    xxx.xxx.xxx.xxx - - [30/Mar/2006:23:14:00 -0500] "GET / HTTP/1.1" 200 28119 gzip: Off, WP-Cache: on
    xxx.xxx.xxx.xxx - - [30/Mar/2006:23:13:05 -0500] "GET / HTTP/1.1" 200 28213 gzip: Off, WP-Cache: off

    why can’t WP-Cache store Gzipped versions of the static files??

    http://spinhex.sytes.net/

    Comment by Loren Lisk — Friday 31/3/2006 @ 5:26

  324. For some reason I am having weird characters replacing any instance of single quotes in my articles, and headlines ‘ when I enable this.

    Single quotes are being replaced by ⤙

    Any idea what’s happening?

    Comment by Hi There — Monday 3/4/2006 @ 12:58

  325. Hi everyone,

    first of all, thank you for a great plugin. it works very well.

    However, there is one issue that i cant resolve.

    I am using a version of wordpress multi user.

    it hosts 5 / homepages. I.e. there are five urls in the form of http://domain.tld/

    once enabled WP-Cache caches / homepage of any domain that was accessed first.

    Then it would serve all 5 homepages of blogs with the same content.

    Other pages such as http://domain.tld/blablabla/uidsui are ok as they are unique for each and every blog.

    Is there a way how i can force / homepage not to be cached ?

    Comment by Vitaly — Wednesday 5/4/2006 @ 15:16

  326. bug report WP2 + lighttpd, php fast cgi initial load come up blank, second run they load just fine.

    Comment by Bug — Friday 7/4/2006 @ 17:21

  327. Resolved (hacked…) the lighttpd+fcgi problem :

    changed ob_end_clean to ob_end_flush to finally have the ob_callback called.
    then made the if (…) inside the callback always true.

    Comment by Bug — Saturday 8/4/2006 @ 10:00

  328. amd

    Trackback by amd — Monday 10/4/2006 @ 17:27

  329. Faced a problem. the plugin stucks ant jumps on an permision denied error at the lines:

    if ( defined(’WP_CACHE’) )
    require (ABSPATH . ‘wp-content/advanced-cache.php’);

    in wp-settings.php

    Do you have any suggestions

    Comment by Aurimas — Tuesday 11/4/2006 @ 7:15

  330. Hey,

    In response to:

    Will, Does your wp-config file have “define(’WP_CACHE’, true);” uncommented?

    Do you have the advanced cache symlink?
    /wp-content/advanced-cache.php -> /wp-content/plugins/wp-cache/wp-cache-phase1.php

    My response:

    Yes and yes

    Thanks,

    Will

    Comment by Will — Monday 17/4/2006 @ 21:17

  331. Hi

    Sorry for my english, i’m french ^^

    So i have a probleme with wp-cache 2.0.17 and wp 2.0.2

    The cache work but when the cache file is created, the page is empty.
    If i refresh, it’s good

    Why the page is white when the cache fil is created ?

    thanks :)

    Comment by Lilo — Tuesday 18/4/2006 @ 15:07

  332. hi. It’s a great plugin,this morning my friend still complained the wordpress’s speed, it seems the web browsed very slowly,then I find a good plugin to sovle the problem.3Q,3Q.

    Comment by wayne — Thursday 20/4/2006 @ 13:02

  333. Hello
    i just tried to install the plugin on wp 2.0.2, because i got kind of macdoted. But as soon as I enable it in the cache manager, I get only empty sites. All files and directories have the specific rights and autoconfigure of wp cache goes fine. The cache directory does even contain some files after activation, but as I said above noting is displayed.

    Comment by Mathias Wagner — Thursday 20/4/2006 @ 15:51

  334. Digg Defender: A Plugin For Wordpress

    An article I wrote about well-designed blogs got more than 1,200 diggs yesterday, causing an influx of some 20,000 to 30,000 new visitors, each pulling down the following page elements:

    10 large images totalling 969,582 bytes
    CSS and JS totalling 21,6…

    Trackback by Elliott Back — Saturday 22/4/2006 @ 3:07

  335. According to this: http://codex.wordpress.org/User:Matt/2.0_Plugin_Compatibility#Plugins_that_don.27t_work

    This plug-in does not work with Wordpress 2.0

    Can you verify that it indeed does.

    Comment by v — Sunday 23/4/2006 @ 19:14

  336. I just installed WP-Cache 2.0 on my WP 2.0.2. If the page is not cached already, it is sending a 0 byte file instead of the HTML, just like the guy who wrote comment 331 described.

    Here’s the link to my site. I set the expire time to 5 seconds so you can actually see what I’m talking about.

    How can I fix this?

    Comment by Roberto — Monday 24/4/2006 @ 5:36

  337. Followed the instructions to change ob_end_clean to ob_end_flush to get it working with WP2.. and it works, well the pages are served OK.. except it doesn’t seem to read from the cache. The cache is written to disk OK.

    How do I get it to read the cached files? Thanks!

    Comment by tom — Monday 24/4/2006 @ 20:20

  338. “#5 Create a symbolic link from wp-content/advanced-cache.php to wp-content/plugins/wp-cache/wp-cache-phase1.php.

    ln -s wp-content/plugins/wp-cache/wp-cache-phase1.php wp-content/advanced-cache.php”

    Excuse my ignorance, but what does this mean? Where (in what file) is this “symbolic” link supposed to be made? What is a symbolic link?

    Comment by v — Monday 24/4/2006 @ 20:28

  339. Update: I just found out a workaround for the problem mentioned in comments #331 & 336: downgrade PHP to version 4.4.2. I was running version 5.1.2 before.

    Comment by Roberto — Monday 24/4/2006 @ 21:33

  340. does using WP-Cache has other side effects? like, it will reduce the number of times the database is accessed, but does it in turn start using more cpu power(to cache the pages and to serve them)? does the changes done to the pages reflect back as soon as they are made? wordpress 2 also does caching; is this plugin superior to it? why doesn’t wordpress use this then? thank you.

    Comment by Speed — Wednesday 26/4/2006 @ 18:36

  341. Ricardo Galli, de software libre ? WP-Cache 2.0

    Someone at Smarking has bookmarked your post.

    Trackback by Smarking — Friday 28/4/2006 @ 1:42

  342. Yo estoy teniendo el mismo problema que comentan arriba, pero en una de mis instalaciones con Wordpress 2.0.2 si funciona el plugin y en el otro no, me aparece una página en blanco pero si refresco si muestra la página correctamente. ¿Alguna idea?

    Comment by Tapanez — Friday 28/4/2006 @ 7:35

  343. I note from the install instructions that a symbolic link is required.. but my wordpress site is on a Windows / IIS server. Will this plugin work on a Windows solution? If so - what do I need to do to get it operational or to get around teh need for a link?

    c0y0te

    Comment by Coyote — Friday 28/4/2006 @ 20:16

  344. I installed wp-cache for a while. Thanks very much. After I switch from the default theme to the tarski theme, I got a problem with wp-cache. If wp-cache is enabled, the reader’s comment on posts will not appear immedaitely. For the reader, it looks like the comment disappears, so they may submit the comment again as a duplication. Later, if I change some posts, or the cache expired, the comments then show up. I contacted the tarski designer, they said that the wp-cache plugin should be indepedent with the theme. So I got no idea now. What should I do to solve this problem? (I temporarily disabled wp-cache now).

    Thanks.

    Comment by zeal — Saturday 29/4/2006 @ 7:58

  345. Se sabe ya la solución para el error del cache?
    Me pasa lo mismo, importé una base de datos antigua y desde entonces tengo problemas con el caché.
    Me carga una página en blanco, pero si refresco funciona sin problemas.

    Ricardo, espero que puedas publicar pronto una solución, tu plugin es una herramienta fundamental hoy en día en la comunidad wordpress, de hecho eres la única solución.

    Comment by cavalleto — Sunday 30/4/2006 @ 22:26

  346. Hi all!

    I’m running WP 2.0.2 and installed it according to the readme. The first time I view a page I get this at the bottom of it:

    Warning: sem_acquire(): supplied argument is not a valid SysV semphore resource in /home/virtual/site7/fst/var/www/html/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 90

    Warning: sem_release(): supplied argument is not a valid SysV semphore resource in /home/virtual/site7/fst/var/www/html/wp-content/plugins/wp-cache/wp-cache-phase2.php on line 99

    That paged is served dynamically. The second time I view it I don’t get the error message, so it only occurs when the page is served dynamically - not when it is cached.

    Any ideas and suggestions? Thanks.

    Comment by TDH — Tuesday 2/5/2006 @ 15:11

  347. Alos, it seems that this plugin doesn’t work with Spam Karma 2. Has anyone had this problem?

    (Disabling Spam Karma 2 did nothing to my problems above.)

    Comment by TDH — Tuesday 2/5/2006 @ 16:03

  348. Hello WP-Cachers!

    First off, just wanted to say THANK YOU for writing this plug-in. After a receiving a stern warning from my Web host, I’ve installed WP-Cache 2.0 on my WordPress 2.0.2 install to cut down on the amount of server resources I take up. Seems to be working like a charm, so you’ve really saved me a lot of trouble! However (and there’s always a however), I’m dealing with one quirk. People who post comments to the blog have up to this point had their name/e-mail/URL information prepopulated as long as they stay on the same computer/browser. I don’t let people sign up for accounts on my blog, so I’m assuming that this is done with a cookie of some kind — I never made a conscious decision to activiate this functionality, so I guess it’s just how WP works by default.

    Anyway, since I activated WP-Cache, commentors are seeing *other people’s* name/e-mail/URL information prepopulated in their browser. This is obviously annoying, and, since I pledge not to expose people’s e-mail addresses publically, somewhat alarming. Does anyone know how to prevent this from happening? Ideally I’d like to go back to the original situation, but if that’s not possible with WP-Cache, I’d like to prevent any of this information from being prepopulated into the fields.

    Thanks in advance!

    jf

    Comment by Josh — Tuesday 2/5/2006 @ 17:15

  349. TDH ? Martes: I’m using WP-Cache and Spam Karma 2 together with no problems.

    jf

    Comment by Josh — Tuesday 2/5/2006 @ 17:15

  350. Can you expand on step #5 like others have asked? What good is putting something out there and then not helping people install it?

    Comment by Clueless — Tuesday 2/5/2006 @ 20:20

  351. Clueless, what you need to do is login using SSH (or Telnet) to your server with a user that has the rights to make symbolic links. That *could* be root only, I’m not sure - I did it with my root access. The just copy the line:

    ln -s wp-content/plugins/wp-cache/wp-cache-phase1.php wp-content/advanced-cache.php

    and hit enter. All set!

    Comment by TDH — Wednesday 3/5/2006 @ 11:50

  352. Josh: really? Then maybe I’m having memory problems on my server. SK2 is such a great plug so it would be a shame not to use it.

    Comment by TDH — Wednesday 3/5/2006 @ 11:50

  353. Clueless is Thankful.

    Comment by Clueless — Thursday 4/5/2006 @ 1:41

  354. but what if you’ve got no telnet login… i cannot create a symlink on my webspace :-( is there a workaround for that problem?

    Comment by cpier — Thursday 4/5/2006 @ 18:47

  355. This plugin is the best I saw. Very easy installation, my server’s cpu use changed from 25 per cent to 1 or 3. It’s near 20 times faster! Thanks for this.

    Comment by surf europe — Saturday 6/5/2006 @ 11:55

  356. Hello,

    I installed Wp-Cache after my host warned of resource usage on my sites. I’m having a problem whtouh. I can enable it fine and your plugin creates the proper config entries and symlink, but when the page renders all I get is my background image.

    I did a view-source and it turns out that the HTML output ends just before the tag, so i’m thinking that it’s a plugin screwing things up.

    Is this the case, and if so are there a set of plugins known not to work? I am running K2 with the recommended plugins, and a few others.

    Thanks in advance for any help, my host is really getting on me about this :\

    Lloyd

    Comment by Dasme — Monday 8/5/2006 @ 20:15

  357. OK so I install the cache and it works fine with WP2 except it only caches my feeds, and nothing else. How do I get it to cache other pages? I am using mod_rewrite for nice URLs and it isn’t clear whether I am specifying the actual filenames or the URLs I want to be cached in the configuration options.

    Any ideas? Thanks

    Comment by tom — Tuesday 9/5/2006 @ 9:04

  358. WP-Cache 2

    Seit heute Abend lassen wir das Plugin WP-Cache 2 laufen. In der vorigen Woche bekamen wir intensive Probleme mit dem Plugin, da während des Cachings selbst der Output irgendwie hängen blieb. Zuerst dachte ich an ein Problem mit unserem mod_r…

    Trackback by Telagon Sichelputzer — Tuesday 9/5/2006 @ 20:58

  359. I’m having a lot of difficulty getting it to work… everything is running.. symlink is up … no errors anywhere just nothing seems to get cached… all the deafults are on I didn’t change anything… I tried some of the suggestions about using flush and still nothing… running wp 2.01 and the latest ver of this plugin… can you email me to work this out?

    Comment by Bart — Tuesday 9/5/2006 @ 21:36

  360. This is exactly what I wanted and it works incredibly well. THANK YOU!

    Comment by Nicolai — Wednesday 10/5/2006 @ 3:49

  361. Hello all-

    Me again … I recently had to implement wp-cache because my Web host warned me that I was eating up a lot of their resources. It solved that problem ably but seems to have caused another.

    My users (and I!) are having intermittent problems posting comments to the site. Sometimes when posting a comment, after pressing the appropriate button to upload the comment to the site, instead of being returned to the individual post screen the user is just taken to a blank screen, and the comment never appears on the site.

    I’m currently using the filosofo comment preview plugin but disabling it causes the same results. Sometimes you can go for hours and not have any problems, and then sometimes any attempt to comment results in this problem.

    I believe that this problem is related to wp-cache because I never had it before I implemented caching. However, I’m not sure exactly what might be causing it. None of the comments-related pages appear to be listed in the “cached pages” lists. Help!

    Comment by Josh — Thursday 11/5/2006 @ 15:29

  362. Hi,

    I have recently downloaded “wordpress-2.0.2.tar.gz” and “wp-cache-2-0-17.zip” to have the cache.

    I have followed all the instructions provided by wp-cache to install it.

    but once I activated wp-cache from wp-admin/plugins. The only this I got was a blank page. I tried to load the pages but, every page on my blog are blank.

    I there any bug in “wordpress-2.0.2.tar.gz” and/or “wp-cache-2-0-17.zip”?

    Or I am doing some thing wrong?

    Comment by sunilkhedar — Friday 12/5/2006 @ 10:29

  363. I’m trying to use a dynamic program like Democracy (poll) with this plugin. I think I’ve gotten close but I haven’t quite figured it out(it gets cached, or throws errors). Any suggestions?

    I’ve:
    - enabled democracy long enough to create a poll.
    - disabled wp-cache …
    - disabled democracy …
    - then, called the plugin manually from the sidebar as described on this page:
    elliottback.com/wp/wp-print.php?p=914
    - re-enabled wp-cache
    - answered the poll
    - it all seems to work until I return to that page and then I get a fatal error because this function is undefined (presumably wpdb):
    ———————-
    $poll_question = $wpdb->get_row(”SELECT id, question, voters, allowusers FROM {$table_prefix}democracyQ WHERE {$where}”);
    ———————-
    Which makes sense since I call the plugin so late in the game.

    Is it possible to work around this … call a dynamic plugin successfully while using wp-cache?

    Comment by blake — Saturday 13/5/2006 @ 20:49

  364. Hello,
    I installed Wp-Cache after found
    the following error:

    advanced-cache.php link does not exist
    (…)
    Cannot continue… fix previous problems and retry.

    Just for you to know. please tell me how to do? thank you very much.

    Comment by Steven — Tuesday 16/5/2006 @ 5:28

  365. i am having problems on my site with wp-cache. the first time a page is loaded, it is added to the cache but not displayed to the browser (tested in FF 1.5, 2.0a, and Safari). Any suggestions?

    Comment by dryan — Thursday 18/5/2006 @ 7:00

  366. First, I’m please that this plugin exists because I run my blog on an old PII with 256megs of ram and this should help a bit
    I installed the latest version and I get the white page issue like a few others.
    Seems a reload of *each* page helps, but if someone adds a comment or so the articles are not showing anymore.
    I manualy went to each article and did a reload, but it won’t matter as tis will break every time someone will add a comment :-(

    Looks like we are a few with this issue, anyhelp is appreciated.

    Digitalfrog

    Comment by digitalfrog — Thursday 18/5/2006 @ 14:53

  367. Symbolic link - comment #300 came closest but I still have no idea what this means… type it in a CMD prompt window? I think not. I’m using Filezilla to ftp up to my ISP’s host (I, like alot of others, do not have my own server) so how do I get this working?

    This is the error I am getting on the options panel:

    advanced-cache.php link does not exist
    Create it by executing:
    ln -s /WP/wp-content/plugins/wp-cache/wp-cache-phase1.php /WP/wp-content/advanced-cache.php
    in your server

    I manually add this advanced-cache file to the server and all the files are 777 but I still get the same error.

    I see 4-5 prior requests for help on the symbolic link step, please be very explicit for us noobies so we can all use this. TIA.

    Comment by Still Confused — Friday 19/5/2006 @ 17:09

  368. haaahaaa….

    Looks like there is a fix:

    1. Open wp-cache-phase2.php file* in your favourite text editor
    2. Find out wp_cache_ob_end function
    3. then inside that function find out line with: ob_end_clean(); (it should be line 219 or about)
    4. and finally replace that line with: ob_end_flush();

    found it here: http://wordpress.org/support/topic/48777

    Frog

    Comment by digitalfrog — Friday 19/5/2006 @ 22:43

  369. how do i insert a symbolic link?

    Comment by fabian — Tuesday 23/5/2006 @ 22:26

  370. Hi everyone,

    First of all i wanted to let you know that i really appreciate your work. I run a pretty large non-commercial site and so wp-cache could prevent me from buying dedicated webserver.

    I do have some questions though. As i said i just installed the plugin. I think it working since i see the cached pages multiplying every second. However i don’t know if i installed it correctly. My index.php is causing the most problems according my webhoster, sometimes it seems to take up 75% of the shared CPU power. Therefore i installed your plugin. The front page loads up 7 excerpts, 30 headlines, 37 comment counts and a lot more. If those queries are cached it would be an enormous power saver. Instead of loading all the queries constantly i want it to load it from the cache and refresh it every 30 minutes. However, when i post a new article, it’s right on the front page on the front page, the same counts for comments in posts. Of coarse iam glad it is there inmidiatelly, that’s the purpose of a news site, being fast. But it leaves me thinking the index isn’t cached after all. Or is it? You can find my website on http://www.nieuwszicht.com It probably helps a little bit if you see the site visually.

    I also have the UTF-8 problem. I installed version wp-cache-2-0-17at first and then installed wp-cache-2-0-2a to fix it. It doesn’t seem to help unfortunately.

    Here is my PHP and SQL information, perhaps it helps:

    Operating system Linux
    Linux kernel version 2.6.9-22.0.1.ELsmp
    Apache version 1.3.34 (Unix)
    Perl version 5.8.7 (more info)
    PHP version PHP/4.4.1 (more info)
    MySQL version 4.1.14-standard

    My apologies for the bad English and thank you in advance for answering the questions.

    Comment by iced — Saturday 27/5/2006 @ 18:01

  371. I installed it and got the blank page problem but corrected it with the ob_end_clean to ob_end_flush trick and it works great.

    Comment by Jaime Iniesta — Tuesday 30/5/2006 @ 11:09

  372. Hey,

    Finally figured out my problem. :)

    wp-settings.php was missing the following:

    after:

    // Change to E_ALL for development/debugging
    error_reporting(E_ALL ^ E_NOTICE);

    Why? I have no idea. Really werid!!! Just glad I finally figured it out.

    About darn time. hehe Working pefectly now. :)

    Take Care,

    Will

    Comment by war59312 (Will) — Saturday 3/6/2006 @ 9:58

  373. Um, let me try that one more time. Werid!

    Hey,

    Finally figured out my problem. :)

    wp-settings.php was missing the following:

    add:

    `// For an advanced caching plugin to use, static because you would only want one
    if ( defined(’WP_CACHE’) )
    require (ABSPATH . ‘wp-content/advanced-cache.php’);`

    after:

    `// Change to E_ALL for development/debugging
    error_reporting(E_ALL ^ E_NOTICE);`

    Why? I have no idea. Really werid!!! Just glad I finally figured it out.

    About darn time. hehe Working pefectly now. :)

    Take Care,

    Will

    Comment by war59312 (Will) — Saturday 3/6/2006 @ 10:01

  374. Well, I’m somewhat embarassed to admit I’m stuck on:

    Upload to your plugins folder, usually wp-content/plugins/ and unzip the file

    Although I have installed dozens of WP Plugins, I have never had to do it this way and have no idea how I would go about it. When I unzip the file on my hard drive I see no sign of any wp-content/plugins/wp-cache/ directory.

    Also, having read all 373 comments carefully, I also don’t see any useable instructions for inserting a symbolic link, despite the fact that people continually ask about it. Like the vast majority of WP users (I expect), I do not have SSH or Telnet access to my host server.

    Can this symbolic link be made using .htaccess and if so how?

    Comment by JohnP — Sunday 4/6/2006 @ 5:32

  375. I followed everything in the manual install but i still get this error:
    “Couldn’t write to: /home/httpd/vhosts/…../blog/httpdocs/wp-content/cache/wp-cache-bade0af957b50b069f1c002b8a0dd3d0.html”

    I have set the directory to writable but still cannot cache.

    Please help me

    Comment by Leion — Sunday 4/6/2006 @ 16:54

  376. I think i solved my problem. It was a setting in the server. Now I would like to ask if it is possible to make one widget dynamic? I am not able to do so for my online counter. Or how can I make my sidebar dynamic?

    Comment by Leion — Sunday 4/6/2006 @ 20:21

  377. Many of using wp-cache seem to have the problem of NOT being able to include any dynamic plugins once wp-cache is enabled. mfunc does not work for dynamic plugins. It sure would be lovely to figure out a workaround. Please, please, if anyone has one, post.

    Comment by blake — Monday 5/6/2006 @ 17:02

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress