WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: WP Super Cache] Modifying settings network wide

[Resolved] [Plugin: WP Super Cache] Modifying settings network wide

  • Hi,

    Is it possible to change plugin settings network wide, so that new settings will be updated to all sub blogs?

    Currently new settings will affect only for new blogs that are created after changing the settings from “Network>>Settings>>WP Super Cache”.

    Now it requires a lot of manual work to change for example garbage collection settings, if I have already 800 sites in my network.

    http://wordpress.org/extend/plugins/wp-super-cache/

Viewing 7 replies - 1 through 7 (of 7 total)
  • I have multisite install and my Network settings seem to be applying to subsites Ok..?

    Plugin Author Donncha O Caoimh

    @donncha

    There’s only one config file that is loaded by all sites so the majority of settings are applied sitewide. Look in wp-content/wp-cache-config.php on your server!

    I investigated this a little bit further and it seems that settings are applied properly, but garbage collection cron job schedule is not refreshed.

    In other words when I change garbage collection settings from midnight to e.g. 7200 seconds, the Cron Job will still run at the midnight if I don’t update expiration settings of sub blogs manually.

    I’ll update the plugin to 1.2 and let you know if the update fixes this issue.

    Updating to version 1.2 didn’t solve the issue.

    I rescheduled wp_cache_gc cron job with the following function and now garbage collection settings are working fine in my sub blogs too.

    function reschedule_wp_cache_gc() {
    
    	global $wpdb;
    
    	$blog_ids = $wpdb->get_col("SELECT blog_id_id FROM $wpdb->blog_ids");
    
    	if ( $blog_ids ) {
    
    		foreach ( $blog_ids as $blog_id ) {
    
    		switch_to_blog_id( $blog_id );
    
    			if ( false == wp_next_scheduled( 'wp_cache_gc' ) ) {
    
    				wp_schedule_single_event( time() + 300, 'wp_cache_gc' );
    			}
    
    		restore_current_blog_id();
    
    		}
    	}
    }
    
    add_action('init','reschedule_wp_cache_gc');
    Plugin Author Donncha O Caoimh

    @donncha

    Ah, garbage collection jobs are scheduled separately on each blog.

    I mark this topic as resolved, but I hope that this feature would be included to the future versions of the plugin in some form.

    Scheduling garbage collection separately on each blog requires too much manual work, especially if you have a lot of blogs in your network.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] [Plugin: WP Super Cache] Modifying settings network wide’ is closed to new replies.