• Hi,

    Firstly thank you very much for a great plugin. We are currently experiencing an issue. We currently have 11 thumbnail sizes registered using add_image_size. Now when we upload an image, the image percentage will go up quite quick, but then once it gets to 100% it will lag for about 1 minute, and then the “crunching” text will show for a bout a half second. What concerns us is the 100% lag for 1 minute.

    Our first thought was W3 Total Cache begins uploading the images to the Rackspace Cloud Files at that point. So we disabled the CDN and managed to upload the file in 15 seconds. When we enable the CDN it takes 1 minute.

    Ideally what we would want is to prevent the user from dealing with this case and the image will be added to the queue for wp_cron to deal with it later. Can we tweak this in anyway?

    Wp Cron will then be run via crontab.

    What do you think?

    https://wordpress.org/plugins/w3-total-cache/

Viewing 1 replies (of 1 total)
  • Thread Starter keendev

    (@keendev)

    Ok so i took a buzz and tried to tackle this myself.

    Step 1:

    add_filter('w3tc_cdn_update_attachment', 'pending_images_to_queue', 10, 1);
    add_filter('w3tc_cdn_update_attachment_metadata', 'pending_images_to_queue', 10, 1);
    
    function pending_images_to_queue($files) {
    
    	$w3plugin_cdnCommon = new W3_Plugin_CdnCommon();
    
    	foreach ($files as $file) {
    
    		$w3plugin_cdnCommon->queue_add($file['local_path'], $file['remote_path'], '1', '');
    
    	}
    
    	return array();
    
    }

    Step 2: (Create Cron which will handle the uploading)

    <?php
    define('WP_USE_THEMES', false);
    require('wp-blog-header.php');
    
    set_time_limit(600);
    
    $w3_plugin_cdn_normal = w3_instance('W3_Plugin_Cdn');
    $n = $w3_plugin_cdn_normal->cron_queue_process();
    
    echo  sprintf(__('Number of processed queue items: %d', 'w3-total-cache'), $n);
    
    ?>

    If I could get a developer to let me know what they think that would be appreciated.

Viewing 1 replies (of 1 total)
  • The topic ‘Rackspace Cloud Files Delay Upload Command’ is closed to new replies.