Antiguo y abandonado blog de Ricardo Galli :-(

Sunday 14/1/2007

New release: wp-cache 2.0.22

Filed under: Mis hacks — gallir @ 23:02

Updated: please try version 2.1, it should wokr in WP 1-5 to 2.1 and with PHP4 and PHP5.

This version solves another bug introduce in 2.0.20 by a previous patch. It didn’t marked as “dynamic” thoses pages with “mfunc” o “mclude” in the .meta file, so the included dynamic code was never executed after the cache file has been generated.

Reported by Sigt and Mark Jaquith. Thanks.

Download version 2.0.22.

The wp-cache-2 page.

32 Comments

  1. WordPress 2.0.22, para los que usan contenido dinámico

    Quería probar algunas cosas con Adsense (en resumidas cuentas: el bloque de anuncios que aparece abajo sigue apareciendo abajo a no ser que vengas desde un buscador: en tal caso ese bloque desaparece y aparece uno igual justo arriba del contenido), me…

    Trackback by SigT — Sunday 14/1/2007 @ 23:22

  2. No es un bug realmente, pero si utilizas scripts de “landing sites” (de los que te dicen que vienes de un buscador, y te pone un listado de paginas relacionadas), evidentemente, se cache también, y lo muestra aunque no vengas desde el buscador… si tengo un rato, miraré a ver si soy capaz de hacer algo (que no creo… pero bueno, lo intentaré)

    Comment by Marcos Ramírez — Monday 15/1/2007 @ 0:06

  3. Marcos para eso están las funciones mfunc y mclude… :)

    Comment by Armonth — Monday 15/1/2007 @ 1:00

  4. does this work on new, upcoming WP 2.1?

    Comment by Tin — Wednesday 17/1/2007 @ 3:34

  5. I upgraded from 2.0.17 to 2.0.22 and am having a problem. When a comment is posted, the cache for that page isn’t cleared. With 2.0.17 it was always cleared. This is WordPress 2.0.7

    Comment by Soccer Dad — Sunday 21/1/2007 @ 0:04

  6. I have the same problem as comment no. 5. i tested wp-cache 2.0.22 with wp 2.0.7 and 2.1. Can you plz fix that? Or say what to do to give your more information. if someone posts a new comment the cache is not cleared and i had to clear the cache manually, that is a very bad solution, cause i get more than 20 comments a day…

    greetings from germany

    Comment by Frieder — Tuesday 23/1/2007 @ 15:44

  7. I can’t reproduce that bug in WP 2.0.6 and WP 1.5.

    Did you delete previous cache files?

    Comment by gallir — Tuesday 23/1/2007 @ 16:24

  8. When upgrade 2.0.20 to 2.0.22, all the metadata values become empty, I can’t see the url of each cache.

    Is that have something to do with the moving of the “new CacheMeta” line?

    Comment by priv — Tuesday 23/1/2007 @ 17:00

  9. It should be write correctly, but there can be issues with some PHP version/consfigurations (there are very strange and old ones).

    What PHP version are you using? Is is a module or CGI?

    Comment by gallir — Tuesday 23/1/2007 @ 17:06

  10. No idea, I’m using Dreamhost, version is 5.1.2 with FastCGI support.

    And since 2.0.20 have missing id problem and will not flush cache correctly, seems 2.0.21 are the best in my environment.

    Beside the blogid, and the metadata incorrect problem that cause cache are not flush, the popular spam karma 2 also cause some problem, with spam karma 2 installed, it actually intercepts all the action and will not pass to system or next filter, so wp-cache don’t have chance to flush cache.

    It’s actually not wp-cache’s bug, but you might want to warn people that sk2 doesn’t work well with wp-cache.

    My workaround is inserting a line in sk2_filter_comment()
    where it notify author that there’s a new comment comes in:

    elseif ( get_settings('comments_notify'))
    {
    wp_notify_postauthor($comment_ID, $sk2_core->cur_comment->type);
    wp_cache_get_postid_from_comment($comment_ID); //directly call wp-cache to flush cache
    }

    Comment by priv — Tuesday 23/1/2007 @ 17:33

  11. Will 20.22 work with the new wordpress 2.1?

    Thanks

    Comment by Damine — Tuesday 23/1/2007 @ 22:57

  12. Hola, yo tengo un problema con la función mfunc, tengo un plugin en el index que muestra los usuario conectados en ese momento, despues de que se va al cache no se actualiza.

    Utilice esto:

    `

    Y cuando recargo la pagina desde el cache me marca que no encontró la función. Me manda este error: Fatal error: Call to undefined function: jusonlain() in …

    Estoy usando WP 2.1 y si sirve de algo Links amigables. Podrias Ayudarme con esto o bien hay alguna manera de hacer que no haga cache del index?

    Comment by DaHouseCat — Tuesday 23/1/2007 @ 23:40

  13. Rayos lo siento puse el codigo de la función… lo siento lo checas por favor =)

    Comment by DaHouseCat — Tuesday 23/1/2007 @ 23:42

  14. can you integrate an option (checkbox..) where users can decide, if cache stays or is deleted if a comment is written by an user?

    Comment by Lazy — Wednesday 24/1/2007 @ 10:27

  15. Tu plugin no funciona en la versión 2.1 de WordPress. Cuando hago un comentario en una entrada o cuando una entrada pasa de programada a activa la cache no se actualiza. Uso PHP 5.2.0.

    Comment by pepe — Wednesday 24/1/2007 @ 11:47

  16. I create a quick fix in spam karma2 plug-in, that will directly call wp-cache to flush cache, once a comment is approved.

    Comment by priv — Wednesday 24/1/2007 @ 14:12

  17. You might have a bug in your latest release. See this post to find out more.

    Comment by seanrox — Thursday 25/1/2007 @ 5:30

  18. Your plugin doesn’t work at all in WP 2.1. Please, fix it.

    Comment by Tom — Thursday 25/1/2007 @ 9:32

  19. Hace unos días que ha salido la nueva versión de WordPress y el plugin wp-cache sigue sin funcionar. Lástima, tendré que dejar de usarlo, era un buen plugin…

    Comment by Zikatriz — Thursday 25/1/2007 @ 20:29

  20. #19, me enteré que no funciona ayer, en cuanto pueda instalo una WP2.1 y veo si se puede hacer funcionar.

    Comment by gallir — Thursday 25/1/2007 @ 21:45

  21. I am experiencing the same problem others have been reporting. WP-Cache 2.0.22 will not flush the cached page when a new comment is added. I did have Spam Karma 2 installed, and I tried installing the plugin for SK2 that priv posted, but that does not solve the problem even though it is enabled in the SK2 options panel.

    I tried disabling every single plugin on the blog, except for WP-Cache. It still did not flush the cached pages on comment post. This suggests that, at least in my case, SK2 is not the problem.

    I also tried resetting the WP-Cache configuration. That did not work either.

    My configuration:

    WordPress 2.1
    PHP 5.2.0 on Apache 1.3 using mod_php
    (Spam Karma 2.2 and Bad Behavior 2.0.9, but it still happens when they’re disabled)

    What I have been doing for now is going to the WP-Cache manager and clicking “delete cache” when I receive notice of a comment.

    Comment by Kelson — Friday 26/1/2007 @ 0:06

  22. I was comment nr. 6.
    I completly removed the wp-cache Plugin, deleted the whole wordpress blog!!! and installed a fresh 2.1 version. With no plugins except for Akismed 2.0 and then installed wp-cache 2.0.22.
    It was the same fault: the cache wasn’t rebuild when a comment was posted!

    Then i did the same thing, but i used Version 2.0.21 and everthing works fine!
    I use PHP 5.1.4 with no PHP Cache like APC or eaccelerator as FastCGI under Lighttpd Webserver.
    Can you try to fix this?
    Please email me if you can fix this, or you already fixed it! thanks!
    i will donate you some cash :) do you have paypal? i really like this plugin, very useful!

    Comment by Politblog — Friday 26/1/2007 @ 3:25

  23. I didn’t know wp-cache does not work in 2.1 until yesterday, i’ll try to fix it (if it’s possible) soon.

    Comment by gallir — Friday 26/1/2007 @ 3:42

  24. the plug-in works fine for me in 2.1, but I’m still using version 2.0.21 that was posted a little while ago. When I upgraded to this version the cache wasn’t cleared after a new comment as others have mentioned.

    Comment by Ryan Wagner — Friday 26/1/2007 @ 19:58

  25. Version 2.0.21 works for me, too.

    Comment by tom — Friday 26/1/2007 @ 20:56

  26. I had tried switching to php4 on dreamhost and 2.0.22 works fine again, so maybe the metadata thing is not correct in php5? I’m not very good at php so don’t know what the problem is.

    Comment by priv — Saturday 27/1/2007 @ 10:55

  27. Still getting the SysV semaphore errors here.

    PHP Warning: sem_acquire(): supplied argument is not a valid SysV semaphore resource in wp-cache-phase2.php on line 105
    PHP Warning: sem_release(): supplied argument is not a valid SysV semaphore resource in wp-cache-phase2.php on line 114

    PHP 4.4.4 (cli)

    Comment by Scott — Monday 29/1/2007 @ 15:12

  28. Hi,
    I think there is a bug. I use PHP 5 and MySQL 5.
    It seems the “meta” file is saved as empty.
    After an analyse, i see that the “ob_end_flush()” function cleans all the member variables of the “$meta_object”.
    I really don’t know why. It’s maybe a PHP Bug ?
    The only way i found to correct was to serialize the meta object before the flush function :

    //Bug ?
    $serial = serialize($meta_object);
    ob_end_flush();

    if ($new_cache) {
    //$serial = serialize($meta_object);
    wp_cache_writers_entry();
    $fr = fopen($cache_path . $meta_file, ‘w’);
    fputs($fr, $serial);
    fclose($fr);
    wp_cache_writers_exit();
    }

    Does anyone has the same bug ?

    Comment by Sebastien — Tuesday 30/1/2007 @ 14:24

  29. ob_end_flush() are called before wp_cache_shutdown_callback() in php4, so everything is ok.

    But in php5 ob_end_flush() will be called explicitly in wp_cache_shutdown_callback(), so the new CacheMeta thing discard the info saved in wp_cache_shutdown_callback().

    You need to initialize $meta_object earlier to prevent this.

    Comment by priv — Wednesday 31/1/2007 @ 15:47

  30. Hello there,

    I installed wp-cache last night and am having some probs.

    Only the RSS feeds appear on the lists of cached pages. Up until recently the other pages were being cached. They weren’t getting served up though or included in the count under the Wp-Cache options. Now it doesn’t look like their being cached at all.

    Otherwise the installation is fine. Appropriate folders are 775 (content and cache), symlink was created okay, gzip is off, the define line was added to the config-file, etc. When things were 777, I got an internal server error.

    Here are the specs:
    Wordpress: version 2.0.x embedded in Joomla via jd-wordpress
    Active plugins used: Akismet, Social bookmarks, wp-cache, WordPress Database Backup

    Thanks for any help you can give.

    Comment by Cat Laine — Wednesday 31/1/2007 @ 17:11

  31. I will upgrade it ;)

    Comment by Jauhari — Tuesday 6/2/2007 @ 8:38

  32. I can’t install this - we don’t have root or shell access to the server - it is a cluster (mosso.com) - so we can’t run the ln -s linking command - any ideas?

    It works great on my wordpress blogs hosted elsewhere though - thnaks!

    Matt

    Comment by Matt Ellsworth — Sunday 22/4/2007 @ 23:40

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress