Title: Disable Object Cache
Last modified: August 21, 2016

---

# Disable Object Cache

 *  [Compute](https://wordpress.org/support/users/compute/)
 * (@compute)
 * [13 years ago](https://wordpress.org/support/topic/disable-object-cache/)
 * 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)

 *  [David Choi](https://wordpress.org/support/users/wpthemes777/)
 * (@wpthemes777)
 * [13 years ago](https://wordpress.org/support/topic/disable-object-cache/#post-3757497)
 * Why not just rename the file
 * `object-cache.php`
 * to something like
 * `object-cache.php.off`
 * to turn it off?
 *  Thread Starter [Compute](https://wordpress.org/support/users/compute/)
 * (@compute)
 * [13 years ago](https://wordpress.org/support/topic/disable-object-cache/#post-3757501)
 * 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
 *  [David Choi](https://wordpress.org/support/users/wpthemes777/)
 * (@wpthemes777)
 * [13 years ago](https://wordpress.org/support/topic/disable-object-cache/#post-3757502)
 * 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](https://wordpress.org/support/users/compute/)
 * (@compute)
 * [13 years ago](https://wordpress.org/support/topic/disable-object-cache/#post-3757503)
 * 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.
 *  [David Choi](https://wordpress.org/support/users/wpthemes777/)
 * (@wpthemes777)
 * [13 years ago](https://wordpress.org/support/topic/disable-object-cache/#post-3757504)
 * 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.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 5 replies
 * 2 participants
 * Last reply from: [David Choi](https://wordpress.org/support/users/wpthemes777/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/disable-object-cache/#post-3757504)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
