• I’d like to disable the object cache, as the file would still load even tho the plugin is not active.

    In wp-includes/load.php the code looks like this:

    if ( file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) {
    	require_once ( WP_CONTENT_DIR . '/object-cache.php' );
    	$_wp_using_ext_object_cache = true;
    }

    Therefore it will always include the object-cache.php file even tho we dont need it now.

    An easy fix could be:

    wp-includes/load.php

    if ( file_exists( WP_CONTENT_DIR . '/object-cache.php' ) && WP_OBJECT_CACHE ) {
    	require_once ( WP_CONTENT_DIR . '/object-cache.php' );
    	$_wp_using_ext_object_cache = true;
    }

    wp-includes/default-constants.php

    if ( !defined('WP_OBJECT_CACHE') )
    	define('WP_OBJECT_CACHE', true);

    Why is it currently not possible to disable object cache?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Why not just rename the file

    object-cache.php

    to something like

    object-cache.php.off

    to turn it off?

    Thread Starter Compute

    (@compute)

    We want to use it on our live sites but disable it on dev sites. When you’re using git it’s much better to keep the same file names

    I see, but I don’t see why you can’t modify the

    object-cache.php

    as your own version to detect developement site and turn it off and turn it on for production site. Or disable it if

    WP_OBJECT_CACHE

    constant is not defined. Because I am sure WP devs won’t change the

    load.php

    file.

    Thread Starter Compute

    (@compute)

    The problem is if you’re using a plugin that’s using that file and you don’t want to hack into the plugin either.

    I also wrote a ticket in the W3 total cache forum but I honestly think this has more to do with a wordpress issue than a plugin issue.

    I see what you are trying to say, but unless you can convence WP developers to change that part of the code, you have to adapt it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Disable Object Cache’ is closed to new replies.