WordPress.org

Support

Support » Plugins and Hacks » [Plugin: W3 Total Cache] CDN in a clustered environment

[Plugin: W3 Total Cache] CDN in a clustered environment

  • aelfred
    Member

    @aelfred

    I’m new to WordPress and am setting up a WordPress site that will run on a number of Windows Servers behind a load balancer.

    W3 Total Cache was recommended to me and, on the whole, it seems to be working very well in particular the CDN options. However I have a problem with the admin site. As I understand it the WordPress admin site will not use the CDN to pull in the images but will use the local uploads folder. And so, dependant on which server the admin user hits , the image for a post may or may not be visible in the admin interface.

    So am I missing some option that will enable each server to either use the CDN images in the admin interface or to have the servers pulling the images locally?

    Thanks in advance for any assistance.

    http://wordpress.org/extend/plugins/w3-total-cache/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Anthony Somerset
    Member

    @anthonysomerset

    You need to really make sure your uploads folder is replicated over your cluster, in linux GlusterFS would be a good candidate to achieve this (or NFS)

    in windows, a standard windows share might do the trick for the uploads folder, that way all servers get access to all the same upload files – i’m not sure how that will handle from a performance perspective though for you and your traffic

    Plugin Author Frederick Townes
    Member

    @fredericktownes

    @aelfred, was what @anthony Somerset said, helpful?

    aelfred
    Member

    @aelfred

    Hi,

    I have gone down the replication route and am using TntDrive to map my Amazon S3 storage as a drive on all the windows servers in the cluster.

    As Anthony points out performance is a concern here and I’m looking into this now…

    Thanks for the responses,

    Aelfred

    TheBlakePetersen
    Member

    @theblakepetersen

    We have a load-balanced set up where we have the Origin server, where we make adjustments to the templates and w3tc config file, that lsyncs out to our collection of Node servers.

    When an admin hits the site, they could be coming to any one of our servers, and may jump to another node during the same session. We can’t force the admins to the Origin and so when they upload an image in the backend, the file is uploaded to the CDN and shows fine on the front-end, but the backend won’t show the images unless the user happens to have made the change to the Origin server and the files were pushed out to the Nodes (which is only 8% of the time).

    Since we can’t force the uploads to go to the origin, there’s no guarantee the files will make it to the origin and sync out to the Nodes, and broken images abound.

    Is there a way we can force images in the backend to use the CDN or is there a way to force image uploads to a specific IP?

    Thanks so much, and AMAZING PLUGIN FREDERICK! Can’t believe how easily the CDN setup was, even having to manually set up the config file for each site on our origin server due to the whole node/lsync issue.

    Plugin Author Frederick Townes
    Member

    @fredericktownes

    @theblakepetersen, consider using an NFS or similar to address that issue. There are numerous ways to do so in a performant manner. Then go ahead and use an origin pull CDN provider.

    TheBlakePetersen
    Member

    @theblakepetersen

    We took a much less elegant route, we just added a jQ snippet to swap the images’ references with the CDN container reference. Easy peasy.

    Hi blake, can you explain your jQ snippet solution a little more? Thanks!

    It sounds like a good solution for me!

    I actually solved it with a RedirectMatch in an .htaccess file .

    RedirectMatch ^/wp-content/uploads/(.*) http://cdn_domain_name.com/wp-content/uploads/$1

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: W3 Total Cache] CDN in a clustered environment’ is closed to new replies.