Is define(‘WP_CACHE’, true) needed for object caching?

I am just reading the docs at https://codex.wordpress.org/Class_Reference/WP_Object_Cache and am not clear on something…

If I install an object cache plugin by adding the drop-in file object-cache.php to the wp-content directory do I need to add define('WP_CACHE', true) to my wp-config.php file to activate caching or will the drop-in file just start interacting with the cache by its mere presence?

1

No, including this constant with a value of TRUE loads advanced-cache.php. Object-cache.php is loaded and used automatically.

See https://wordpress.org/support/article/editing-wp-config-php/

Leave a Comment