wp 2.5.1 and caching -- how is wp 2.5.x managing it? (22 posts)

  1. tcd
    Posted 8 years ago #

    I have an installation of wp 2.5.1 in italian on a webhost that limits the number of MySQL queries per hour. So I need to cache dynamic pages.

    This wp install is currently running under PHP 4.4.8, but with zlib.output_compression disabled and cannot be enabled via htaccess.

    My current wp-config has in it the following lines:
    define('ENABLE_CACHE', true);
    define('WP_CACHE', true);

    I even made a "cache" folder within wp-contents.

    But even after logging off, erasing cookies and clearing my browser's cache, disabling, I don't see at all the famous line: "<!-- Cached page served by WP-Cache -->" at the end of html source.

    Before I get back to my webhost's support forum I tried getting my bearings on this new version's support of caching... and, oh boys, I'm a bit pretty much confused.

    Aside from the fact that documentation (codex et al.) related to this cache do not report at all any reference to wp version, aside from the fact that not many messages in this support forums have much details on their wp version, aside from the fact that even third-party caching plugins either are out of date or don't tell much about which wp versions works with their plugin...

    Aside from all that asides above, what I really would like to know is:

    a) Has someone of the developers inadvertently modified/removed from the output of WP the "cached page" message?

    b) Or have you decided to use only PHP5's APC feature without even upgrading documentation pages?

    c) Or you changed all the hooks to wp_cache functions?

    I tried peeking into the code of wp at phpxref but, though it contains only the wp 2.5 files, I've been left with the feeling that cache-related code isn't actually used. I might be wrong, and I'm sure that a deeper and careful look at the code may confirm I'm wrong, but I do not have the leisure to read (and understand) other people's php code for free.

    Please tell me what are the requisites for wp to start caching pages, because after three or four days of battling I'm befuddled and I'm not yet sure if it's some problem with wp or if it is my webhost's fault.

    Some meaningful/useful reply would be appreciated.

  2. tcd
    Posted 8 years ago #

    Is there someone in the know that would care to enlighten me on the current status of server-side caching of wordpress pages/articles?

  3. Ivovic
    Posted 8 years ago #

    Hellooo dahlink.

    I dunno about anyone else but this line stood out to me.

    "I do not have the leisure to read (and understand) other people's php code for free."

    And yet you expect others to not only give you their code for free, but also explain it, for free.

    Why the flying firetruck do so many people feel the world owes them an answer? Where does that rancid attitude come from?

  4. whooami
    Posted 8 years ago #

    ahh, welcome to the wonderful world of wordpress -- eventually you'll understand why my replies can be so impatient.

  5. Edit: *SNORT* People got to it before me, while I'm typing. Whoo and Ivovic, I try to reply this way as part of my therapy :)

    That message at the end of the source is added by a caching plugin. It's not part of the default WordPress install.

    In 2.5.1 I believe the WordPress native file caching has been removed so this portion should not be needed any more (someone will correct me on that one if I'm wrong):

    define('ENABLE_CACHE', true);

    Do you use fancy permaliks? Try downloading and installing Doncha's WP Super Cache.

    If you set up the file and directory permissions correctly (wp-content, wp-content/cache, some file permissions for wp-config.php and .htaccess) then this will create static copies of your posts and pages.

    After you enable the plugin, go into the Settings -> WP SuperCache and enable the caching. Read the output on the page; it will tell you if it has a problem that needs fixing.

    The plugin walks you through it and if it can't modify your config it will say so when you go to enable it in the settings menu.

    Static pages means no mysql queries made. If the pages are updated by you or when people leave a comment, the old copy gets zapped and a new copy gets generated.

  6. Ivovic
    Posted 8 years ago #

    you know, usually I'm a quick study, but for some reason I keep getting stung by this.

    I thoroughly apologise to you, whooami, for ever taking exception to anything you've ever said... I can't really remember what it was that made us collide once or twice, but whatever it was, I'm now thoroughly convinced yours was the sane voice in that.

    back in the early 90s I did the IRC help channel thing. I cut my teeth on that, and on forums for the better part of a decade, until finally taking a 6-year sanity break.

    I'm actually really disheartened that nothing's changed.

    edit: jdembowski, you're a better person than I am.

  7. whooami
    Posted 8 years ago #


    this is not therapy!! :)


    and it wont ever, unfortunately. Its not just a wordpress thing, though, it could be argued that WP is the windows version of blogs, so a similar dumbing down takes place, that's manifested on these forums.

    I am not suggesting that WP users are generically dumb, or dumber than other bloggers, just that the supposed ease with which it can be installed, results in an uninformed and sometimes very impatient user profile.

    PS: Im over whatever it was; if I didnt have thick skin, I wouldnt still be here.

  8. Bystanders: "Why do you keep hitting your head on the wall??"

    Me: "'Cause it feels great when I stop."

    To each their own :)

  9. Ivovic
    Posted 8 years ago #

    this is not therapy!! :)

    actually, this was kind-of refreshing, this little mutual-understanding thing we have going here.

    Hello, my name is Ivovic, and I'm a support-o-holic.

  10. whooami
    Posted 8 years ago #



  11. tcd
    Posted 8 years ago #

    @ivovic: apologies if my snippet on reading other people's code "for free" displeased you, but unless someone delivers me 48-hours days, I really don't have much spare time available for trying to debug on my own php code written by other people. :)

    ...I still have to work for a living, too :D

    And you have to admit that to someone new to wordpress, trying to make sense and rhyme out of the presently available codex documentation is something that takes time, especially if english isn't their native language.

    Anyway, thanks for your reply.

  12. tcd
    Posted 8 years ago #

    Ok, I've installed the wp supercache (for the umpteeenth time), removed the "define('ENABLE_CACHE', true);" from the config file, but it doesn't seem to work :p

    Keeps saying 0 pages cached and something similar, cache folders keep staying empty, html source of wp pages keeps NOT having the lines Donncha said would be there.

    So I'm asking my webhost if it has mod_mime enabled (and it is htaccess-modifiable) and php safe mode activated.

    Now as it is sunday here and I'm already late for my doings, I'll just thank you again and see you later, when (and if) I get an answer from them managers.

  13. I might have missed it but do you have fancy permalinks turned on? If it is set to something like


    then you should be good.

    If permlinks is set to the default, then wp super cache won't get engaged. The permalinks can be anything, just not the default.

    Also, a link to your blog might be helpful.

  14. tcd
    Posted 8 years ago #

    yep, fancy permalinks were set to "month and name" (/%year%/%monthnum%/%postname%/).

    The blog is on cyberdeaf.altervista.org and I haven't yet written much in it. Initially I installed the italian version of wp but, just to be sure, I had it reverted back to english (through wp-config.php), just to see if WP-super cache was language-dependent. Still no dice.

    From my webhost's support forum they say that php safe mode is turned on. For mod mime I still have to get a reply.

    From settings panel I've set the super cache to half off and to on, logged off and erased all cookies in both cases, but I still don't get any caching.

    If I knew which files I should chmod/chown, I'd do it in a flash ;). However, as it's still early morning here, I must wait for caffeine to find its way to my brain before trying to do anything. :P

    *snores faintly*

  15. Really bizarre. Your wp-content/cache directory exists, but the wp-content/supercache and meta directories don't.

    Try doing something real temporary. Change the permissions of wp-content/cache to 777 and visit the blog with a browser.

    chmod 777 wp-content/cache

    If it's a permission issue, then as soon as you browse then supercache and meta directories should get created in the wp-content/cache directory. I say temporary because you are using a shared server and making the directory world writeable is not a good thing.

    If it works then you know it's a permission issue.

    Also can you check your web servers error_log file? PHP might be tossing warnings.

    Create a file like phpinfo.php on your server and put in it


    I think that will let you know what has been built into your PHP.

  16. tcd
    Posted 8 years ago #

    I cannot have a direct access to the error_log file, would enabling the "debug" define in wp-config be as useful?

    I already did the phpinfo(), but the only thing in it that I found and that might be relevant is that 1) the webhost is running a version of php "totally-not-off-the-shelf", e.g. re-compiled by them 2) though they have the zlibs compiled in php, they've disabled gzip compression both in main php.ini and by htaccess (every time I try to enable it thru htaccess I get a nice big no-no)

    this evening (GMT+2), if the lusers at work haven't yet worn me out, I'll try the chmodding and, if necessary, I can also copy over the phpinfo output (or just tell me which pieces of it are necessary, as I don't want to make this thread a queen-sized bed-sheet! :p)

    thank you :)


  17. tcd
    Posted 8 years ago #

    I tried chmodd'ing the cache dir to 777, but no dice. There is already a folder called "meta" in it, but this, too, is empty. I tried creating manually the folder "supercache", chmodding it to 777, but still no juice (I enabled the full service, supercache and wpcache both on).

    If I'd enable the "strutting" footer (the one about being immune to digg effetcts), it'll appear willingly on the kubrick theme. But still won't cache.

    Weird, huh?

    Will put them back to 775, (frown away, I agree with ya on that, but it is the default for all the users on that webhost)...

    this evening I'll try turning the debug define on and give a deeper look at that phpinfo output :p

    *runs to grab lunch*

  18. Well, all I can offer at this point is "Enjoy your lunch".

    I'm stuck. There is something odd going on about your installation. Without seeing the output on error_log (might be tough for you to get) I don't see how to move this forward.

    Good luck.

  19. tcd
    Posted 8 years ago #

    yeah, I agree: I've run out of hypothesis on what may might be the cause for that no-caching.

    I've been poring over the output of phpinfo (php is vers 4.4.8). Aside from the zlib compresison turned off, it has also the Virtual Directory Support disabled (whatever this means, in the depth of nighttime...) and it reports apache as having those modules loades:
    "core mod_authn_file mod_authn_default mod_authz_host mod_authz_groupfile mod_authz_user mod_authz_default mod_auth_basic mod_include mod_filter mod_deflate mod_log_config mod_logio mod_env mod_expires prefork http_core mod_mime mod_status mod_asis mod_cgi mod_vhost_alias mod_negotiation mod_dir mod_actions mod_alias mod_rewrite mod_so mod_fastcgi sapi_apache2"

    At this point I'm totally and wholly feeling stumped and I'm tempted to go ask donncha for his opinion.

    I better try activating the debug define, before writing in the webhost support forum. All this after I've gotten some sleep, tho'.

    Thanks jdembowski :)

    good night to y'all outta there.

  20. tcd
    Posted 8 years ago #

    Apologies for disappearing. Had to meet some deadlines full-frontal :p

    Ok, after inserting the "define('WP_DEBUG',true);" in the wp-config file, I get some notice-level errors above and below the plain default wp page.
    The ones regarding Donncha's plugin tell:

    Notice: Undefined index: p in /users/webfolder/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 479
    Notice: Undefined index: p in /users/webfolder/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 480
    Notice: Undefined index: Last-Modified in /users/webfolder/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 335
    Notice: ob_end_flush() [ref.outcontrol]: failed to delete and flush buffer. No buffer to delete or flush. in /users/webfolder/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 370

    At a first glance it looks like wp-super-cache isn't getting some values from the loop. And it says clearly it ain't got anything in the buffer.

    I'll try looking in the code, hoping it won't go over my head.

  21. Donncha O Caoimh
    Posted 8 years ago #

    WP Super Cache doesn't work very well when you have safe mode turned on. You need to get that turned off or move to a better host. Sorry.

    BTW - thanks for reporting those notices. They're harmless but I've added code to stop them.

  22. tcd
    Posted 8 years ago #

    Thanks Donncha, I'm glad I've been somehow useful to anyone in all my insuccesses LOL.

    I've tried another caching plugin (Hyper Cache). It doesn't work, too.

    My first impression is that altervista (that's the host i'm on), in its personalized php version, might have disabled some functions such as:
    ob_start() and ob_end_flush()...

    I'll ask them WHICH funcions they have disabled, 'cuz I'm getting bored of this wild goose chase ^_^

    btw, if you want to see their php setup, you can use the phpinfo page here: http://cyberdeaf.altervista.org/pinfo.php

    (yeah, I'm starting to think I should try a better hosting site -- I chose altervista because they were italians like me, ergh.)

Topic Closed

This topic has been closed to new replies.

About this Topic