WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
[resolved] Modifying settings network wide (8 posts)

  1. Mikko Virenius
    Member
    Posted 1 year ago #

    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/

  2. whatsupmf
    Member
    Posted 1 year ago #

    I have multisite install and my Network settings seem to be applying to subsites Ok..?

  3. Donncha O Caoimh
    Member
    Plugin Author

    Posted 1 year ago #

    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!

  4. Mikko Virenius
    Member
    Posted 1 year ago #

    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.

  5. Mikko Virenius
    Member
    Posted 1 year ago #

    Updating to version 1.2 didn't solve the issue.

  6. Mikko Virenius
    Member
    Posted 1 year ago #

    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');
  7. Donncha O Caoimh
    Member
    Plugin Author

    Posted 1 year ago #

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

  8. Mikko Virenius
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.