WordPress.org

Ready to get started?Download WordPress

Forums

WP-Cache (42 posts)

  1. gallir
    Member
    Posted 9 years ago #

    I just released WP-Cache 1.0 after serveral weeks of developing and testing:

    http://mnm.uib.es/gallir/posts/2005/02/02/111/

    WP-Cache is extremely efficient WordPress hack –not a simple plugin– for page caching. It 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.

  2. XeroCool
    Member
    Posted 9 years ago #

    Testing now. Thanks.

    Ok. Im running WP 1.2.2 and It doesnt appear in the plugins area to activate. All other plugins I use work fine.

  3. Matt Mullenweg
    Troublemaker
    Posted 9 years ago #

    Probably because it's not a plugin.

  4. Matt Mullenweg
    Troublemaker
    Posted 9 years ago #

    However it would be nice if it didn't require changing core files. What if we put a file_exists call early in the wp-settings execution that could include a cache plugin if it existed? You'd only ever want one caching plugin at a time. Then a do_action() call later could catch CachePhase2().

  5. XeroCool
    Member
    Posted 9 years ago #

    Then where do we insert the file?

  6. Matt Mullenweg
    Troublemaker
    Posted 9 years ago #

    The instructions are on the linked blog.

  7. XeroCool
    Member
    Posted 9 years ago #

    Do I look spanish/french to you or whatever language the site is in :S?

  8. gallir
    Member
    Posted 9 years ago #

    The above link is the article --with instructions-- in English. Or at least in my English (hint: I'm Spanish).

  9. XeroCool
    Member
    Posted 9 years ago #

    Now its in English..;/

  10. John
    Member
    Posted 9 years ago #

    Can a plugin add its self to $acceptableFiles

    like for instances


    if(class_exists("CacheMeta"))
    $acceptableFiles[] = "wp-advanced-stats.php";

  11. lstelie
    Member
    Posted 9 years ago #

    suggestion :
    Instead or rewriting from scratch what already does exist, may be it would be a great idea to write a tutorial about how to use PEAR:Cache_Lite with WP
    http://pear.php.net/package/Cache_Lite

    My two cents

  12. gallir
    Member
    Posted 9 years ago #

    Did you see the Wp-cache code?

    Do you know it re-uses code from Staticize?

    Do you is extremely optimized for WordPress?

    Do you know is fun (and easy) this kind of programming?

    Do you know I enjoyed programming it?

    Do you know we do it for fun?

  13. gallir
    Member
    Posted 9 years ago #

    New version for WordPress 1.5, easier to install and configure:

    http://mnm.uib.es/gallir/posts/2005/03/12/178/

  14. davidchait
    Member
    Posted 9 years ago #

    Ricardo -

    Glad to see you've updated for 1.5. Nice. But, at some point, you really should add some history description BACK into the code, since you based off of Staticize, and that had it's own historical tracking of the work.

    Just a suggestion -- since your message last month asked "Do you know it re-uses code from Staticize?", and if it wasn't that I hacked up my own version of Reloaded, no, I wouldn't have had any idea that you had extended an existing work of code... ;)

    Keep the features coming!

    -d

  15. gallir
    Member
    Posted 9 years ago #

    About release notes, yes, you're right. I will add it soon.

    OTH, in the release notes of 1.0, http://mnm.uib.es/gallir/posts/2005/02/02/111/, I explain the history and how is derivated from Staticize-reloaded, I also added a trackback to the original staticize-reloaded post.

  16. davidchait
    Member
    Posted 9 years ago #

    Understood..

    also - is there a reason you went the semaphore approach? That'd look to be something that isn't always available to a particular php install. when I hacked up Reloaded for my own use, I added proper flock()s, but I know that there are certain OSes that apparently don't respect flock (or just plain don't implement it)... though I have never been told which ones. Adding flock solved all my issues during my slashdotting... ;)

    -d

  17. greatbananas
    Member
    Posted 9 years ago #

    Anyone had luck enabling or installing the sysvsem module that is required to have the WP-Cache to work?

  18. gallir
    Member
    Posted 9 years ago #

    Two things:

    1. New small fix version of the plugin, 1.5.1: http://mnm.uib.es/gallir/posts/2005/03/22/200/

    2. I chose semaphores because I used to them and it's the simplest straightforward solution to the problem. I'm studying hpw to do it with flocks, but still have to see how to maintain consistency while writing two different but related files (content+meta) and also how to ensure atomicity when deleting expired files. According to some comment it seems that the ony way is to flock the directory, but I really hate this dirty tricks having a clean one.

  19. gallir
    Member
    Posted 9 years ago #

    So, finally I added support for flock too. WP-Cache now autodetects (since version 1.5.2) if semaphores are available, if so, it uses it. Otherwise it uses flock().

    It should be problems for most people now, especially those that contracted external hosting with no semaphores support.

  20. notRyan
    Member
    Posted 9 years ago #

    Fatal error: Call to undefined function: sem_get() in /home2/ryan/public_html/blog/wp-includes/wp-cache.php on line 106

    I get that error. Does that have to do with the fact I have gzip enabled (it's enabled default by server admin)?

  21. kjhealy
    Member
    Posted 9 years ago #

    WP-Cache worked right away for me without a problem --- it really improved the responsiveness of the site, too. The only trouble was that it seemed to cache things too eagerly. In particular, I could no longer moderate comments, I think because /wp-admin/post.php was getting cached. Is this a known issue?

  22. kjhealy
    Member
    Posted 9 years ago #

    I think I see what was happening. WP-cache uses the variable

    $script = basename($_SERVER['SCRIPT_NAME']);

    to see whether the current script is administrative or not. (It checks to see whether the string 'wp-' is in it. But my host provider (Dreamhost) runs PHP as a module, I think, and this disables the function (eval()?) that makes the SCRIPT_NAME variable useful. It will return something /cgi-system/php.cgi instead of something useful.

    Replacing the variable assignment above with

    $script = basename($_SERVER['PHP_SELF']);

    seems to fix this problem. It seems like this was an issue for the WordPress developers earlier in the year: see this report.

  23. kjhealy
    Member
    Posted 9 years ago #

    You have to replace SCRIPTNAME with PHPSELF in the relevant if statement too, obviously.

    if( !in_array($script, $acceptableFiles) && strstr($_SERVER['PHP_SELF'], 'wp-') )
    return;

  24. gallir
    Member
    Posted 9 years ago #

    Important: vesion 1.5.3 and 1.5.4 fixed a couple of showstoppers. Upgrade it please, you will get also flock() if semaphores does not work in your server.

    http://mnm.uib.es/gallir/posts/2005/03/12/178/

  25. gallir
    Member
    Posted 9 years ago #

    Sorry, forgot the changelog.

    Changelog:

    2005-03-25: 1.5.4 Fixed a stupid regression, it was creating lot of semaphores. Sorry.

    2005-03-24: 1.5.3 Changed SCRIPT_NAME to PHP_SELF as Kieran suggested

    2005-03-23: 1.5.2 It autodetect semaphores, if they are no available, it uses flock.

    2005-03-22: 1.5.1 Check for buffer size, if zero, don't process it. gallir

  26. greatbananas
    Member
    Posted 9 years ago #

    how do I know it is working properly? Should the cache folder be filled with files after I load it?

  27. gallir
    Member
    Posted 9 years ago #

    Yes, basically checking that directory, but also you can check it directly from the browser. Check the 1 or 2 lines ate the end of the html source.

  28. greatbananas
    Member
    Posted 9 years ago #

    Weird. I followed the simple 3 step instruction to install the plugin but nothing happens at all. Not even errors. http://www.happycrumb.com is my site. I also have semaphores modules on the server. If anyone had this problem please let me know. Thanks.

  29. alastc
    Member
    Posted 9 years ago #

    I followed the simple 3 step instruction to install the plugin but nothing happens at all. Not even errors.

    I got that to start with because it wasn't targetting the cache folder properly. My 'home' is different from the wp home, so I hard coded $cache_path.

    Unfotunately, I'm on debian stable, which is pre php 4.3, so several functions dont' work. However, I'm going to update the OS for this, it realy makes a difference!

  30. bloodylamer
    Member
    Posted 9 years ago #

    Solid work on this plugin! The site's so much faster now.

Topic Closed

This topic has been closed to new replies.

About this Topic