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:

    <?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 -->
    perqa

    (@perqa)

    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 https://github.com/Automattic/batcache/issues/22

    @perqa,

    Can you paste the code you’re actually using?

    perqa

    (@perqa)

    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: http://stackoverflow.com/questions/21666550/why-is-my-wordpress-site-on-gae-not-being-cached/21749209#21749209.

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