Support » Plugin: Batcache » How to set advancedcache options in WP Config

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi James,

    I’m doing this by having a file named batcache-config.php, which is included in wp-config.php this way:

    if ( file_exists( dirname( __FILE__ ) . '/batcache-config.php' ) ) {
    	include( dirname( __FILE__ ) . '/batcache-config.php' );

    And this is the content of my batcache-config.php:

    // =================
    // Batcache settings
    // =================
    global $batcache;
    $batcache = array(
    	'max_age'           => 300,
    	'remote'            => 0,
    	'times'             => 1,
    	'seconds'           => 0,
    	'group'             => 'batcache',
    	'unique'            => array(),
    	'headers'           => array(),
    	'cache_redirects'   => false,
    	'redirect_status'   => false,
    	'redirect_location' => false,
    	'uncached_headers'  => array( 'transfer-encoding' ),
    	'debug'             => true,
    	'cache_control'     => true,
    	'cancel'            => false,

    I agree with you, an example on how to use a custom configuration would be really great for people who don’t like reading the code to know what to do. I hope this helps.

    @andrés Villarreal Why do you have debug set to TRUE?

    If debug is set to true, the information about the served page is displayed. If set to false, the information is hidden.

    The advanced-cache.php specifies this:

    var $debug   = true; // Set false to hide the batcache info <!-- comment -->

    I get a warning when trying to do this:

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in /Users/per/google-cloud/my-app/wordpress/wp-includes/plugin.php on line 199

    This issue has also been reported on


    Can you paste the code you’re actually using?

    Thanks for reaching out so quickly! I have found the cause of the problem: I blindly followed the config instructions provided by Google. Inserting the batcache config *in the right place* in wp-config.php, solved the problem!

    More details provided here:

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to set advancedcache options in WP Config’ is closed to new replies.