W3 Total Cache
Use in a multi-server environment and on-demand uploads (3 posts)

  1. deltafactory
    Posted 2 years ago #

    Hello, I have a couple questions for the community:

    We're using W3TC to push files to S3/CloudFront and are about to roll out multiple servers to operate in tandem. How can I tell W3TC which server is the "master" that should be the only one to try to run the CDN update cron job?

    In all other respects, caching management operations should be shared across all servers, e.g. object cache invalidation.

    Is there a constant that can be set in wp-config.php to make this possible?

    Separately, we are running BuddyPress and have circumvented the problems on the avatar upload page by adding the DONOTCDN constant into the change-avatar template. However, we're still seeing a delay in sending the image to S3. What's the simplest way to upload these images on demand, for example when saved or generated during the media upload? I don't have a problem writing my own plugin hooks to do this but I need some assistance finding the right methods and arguments to use. Is there development documentation?

    Based on this discussion it looks like this is the heart of the functionality:

    $w3_plugin_cdn =& w3_instance('W3_Plugin_CdnCommon');
    $w3_plugin_cdn->upload($files, false, $results);

    Is this the right path or is there a better way?


  2. deltafactory
    Posted 2 years ago #

    At this point, I need to push uploaded files incrementally. It's causing problems. It would be nice if there were better docs for this sort of integration.

  3. Frederick Townes
    Plugin Author

    Posted 2 years ago #

    There is no method to limit CDN uploads to one server. Any reason you are not using a pull setup?

    A work around could be removing the hook for w3_cdn_cron_upload for the servers not doing uploads in some plugin. THe functionality for cron and queue recides in lib/W3/Plugin/Cdn.php

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • W3 Total Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic