Support » Installing WordPress » WP_CACHE setting effects

  • I could not find any docs about WP_CACHE constant declared in wp-config.php.

    So, what happens when you declare the constant wp_cache, eg. define(“WP_CACHE”, true);?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Prior to WordPress 2.5, data stored using the wp_cache functions was stored persistently if you added define(‘WP_CACHE’, true) to your wp-config.php file.

    This is no longer the case, and adding the define will have no effect unless you install a persistent cache plugin (see examples below).

    https://developer.wordpress.org/reference/classes/wp_object_cache/
    Thread Starter islp

    (@islp)

    @sterndata This page should be reviewed, imho

    When you use the WP_CACHE constant in the wp-config.php file, it activate the cache for WordPress. This features reduce the server load and improves the site’s speed for a smoother experience for users.

    In versions of WordPress before 2.5, if you included define(‘WP_CACHE’, true) in the wp-config.php file, the data stored through wp_cache functions would stick around even after you closed the website. But things have changed now. Simply adding the define won’t do anything unless you’ve installed a special plugin for persistent caching.

    If you don’t specifically define it, WordPress will automatically set WP_CACHE to false, and it won’t load the advanced-cache.php file by default.

    Caching plugins often mention the WP_CACHE constant in their setup files. When multiple caching methods are active simultaneously, conflicts can arise. To see if the issue notice disappears, try temporarily deactivating caching plugins.

    Thread Starter islp

    (@islp)

    @clayp I’m a little bit confused. Check this thread: https://wordpress.org/support/topic/wp_cache-constant

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.