WordPress.org

Ready to get started?Download WordPress

Forums

Website not updated when database changes (18 posts)

  1. lawtai
    Member
    Posted 8 years ago #

    I went into the database to manually change my user description. However, I noticed that the setting isn't being changed by the webpage itself. If I go in through WP to change it in the admin, then the user description gets updated. This is a problem for me as I'm updating html code which gets parsed to characters when I update through the admin panel.

    Is there a reason why making changes in the database doesn't immediately reflect on the webpage itself?

  2. Kafkaesqui

    Posted 8 years ago #

    I'd suspect the new disk cache functionality in WP 2.0. You can disable caching (temporarily or permanently) by adding this line to your wp-config.php

    define('DISABLE_CACHE', true);

  3. lawtai
    Member
    Posted 8 years ago #

    thanks, that did the trick! Do you know how long it caches for before updating again?

  4. vkaryl
    Member
    Posted 8 years ago #

    Hey, KafkaesquĆ­ - how do you make it permanently disabled?

  5. lawtai
    Member
    Posted 8 years ago #

    I would think you'd just leave that line in your wp-config.php permanently

  6. vkaryl
    Member
    Posted 8 years ago #

    As opposed to messing about with the wp-config.php file on a daily basis? Oy. Sheesh.

    Okay. It can just live there forever. As I posted somewhere else, why do I need a cache anyway?

  7. Kafkaesqui

    Posted 8 years ago #

    lawtai, last I checked the cache is updated either once a day or by specific WP events. However, there is a PHP constant for expiration time on the cache you can set:

    define('CACHE_EXPIRATION_TIME', 86400);

    Time value is in seconds. Set to whatever is desired (although a value of 1 is probably self-defeating).

    vkaryl, WP 2.0 offers a wp_cache_flush() function, so there's nothing stopping some plugin developer with free time from adding a little button in the admin pages which clears it. Oh, for some free time!

  8. vkaryl
    Member
    Posted 8 years ago #

    *laughing* Heh - free time? What's THAT? Okay - that would be nice.... but I'm not by any means capable of producing it.... so I'll either add in the exp time line or just leave it permanently disabled - as I said, why do I need it anyway? (The cache, I mean....)

  9. Kafkaesqui

    Posted 8 years ago #

    On busy sites it can aid in response times, since a cached, static document residing on the server can be retrieved a lot quicker than a PHP document performing a bunch of sql queries and whatnot. It's all about speed. Well, speed and load.

  10. vkaryl
    Member
    Posted 8 years ago #

    Oh. Heh. Well, no WONDER I don't need it then.... *laughing*

  11. Kafkaesqui

    Posted 8 years ago #

    Even on let us say "leisurely" sites it can provide some improvement. But that's up to the admin to decide...

  12. vkaryl
    Member
    Posted 8 years ago #

    Oh, WHAT a kind man you are tonight! Tell you what though, I think I'll just do my "leisurely" thing until some wonderful plugin programmer produces that nifty li'l button....

    Viper - you out there, buddy? Listening?

  13. richards1052
    Member
    Posted 8 years ago #

    I love the idea of speeded up response time through using the new cache system. But in some cases, it's taking me 20-30 minutes before I can see edited posts display the material I've added to them. This just doesn't work for me.

    last I checked the cache is updated either once a day or by specific WP events.

    Would a "specific event" include publishing or republishing a post or publishing or deleting a comment? If so, perhaps the cache isn't working properly in my case or there's a bug in it since as I say I'm not seeing newly edited material.

    I think I'll have to disable the cache as well. Can Kafkaesqui or someone tell me whereabouts in the config.php file I'd place that code?

    BTW, before upgrading to 2.0 I had wp-cache plugin installed until it started doing the same weird things (not allowing me to clear my cache & see updated web posts & web pgs.). I'm guessing that there must be operational similarities between the new wp cache & wp-cache.

    Is there any way I can continue to use the cache but set the expiration time to a short enough time frame that it would allow me to see newly edited pgs?

  14. Kafkaesqui

    Posted 8 years ago #

    When editing wp-config.php, place any of the suggested additions anywhere before this line:

    require_once(ABSPATH.'wp-settings.php');

    Yes, events which should update the cache include publishing posts. However, I'm not educated enough on the built-in cache functionality to say right now which events update what, and what exactly is being cached.

    For defining CACHE_EXPIRATION_TIME you could try a few minutes or so, 120-180 seconds. Even that should provide a small benefit over non-caching (on busy sites). But again, as I've not completely investigated this feature of 2.0 I can't say all of what is affected by CACHE_EXPIRATION_TIME, or if it will help in your case.

  15. richards1052
    Member
    Posted 8 years ago #

    Sorry if I appear dense (I just want to understand clearly what will happen) but, if I set that expiration duration that means that if the cache doesn't clear itself immeidately & automatically ( as I believe it should) then within say 120 seconds I will definitely be able to see the changes to the post?

    Or did I miss something?

  16. gpaulson
    Member
    Posted 8 years ago #

    I have just installed the cache-flush plugin ( http://www.xyooj.com/blog/plink/technical/31/plugin-to-flush-wordpress-cache/ ) because I was having problems when I edited posts it would pull up the cached version for me to edit instead of the version with the changes I had just made.

    Kind of a pain to have to go 'hit the button' but much easier than going in and manually deleting the cache files.

    My other wish is that the cache directory was not placed in the 'wp-content' directory since wp-content contains the files that should be backed up regularly and there is no need to backup the cache. Too bad it was not placed in a wp-cache directory at the same level as wp-content.

  17. miscblogger
    Member
    Posted 8 years ago #

  18. johnh44
    Member
    Posted 8 years ago #

    Is this caching problems related to editing a page (I'm getting all the above symptoms) and then ALSO GETTING a 404 error, page cannot be found when you finally hit SAVE?

Topic Closed

This topic has been closed to new replies.

About this Topic