WordPress.org

Forums

W3 Total Cache
W3C Total Caché, Self Hosted CDN in different machine (10 posts)

  1. amenadiel
    Member
    Posted 4 years ago #

    Hi.

    I'm currently hosting several blogs on rackspace over multiple servers and a load balancer. (let's say they are http://www.blog1.com and http://www.blog2.com)

    I have an independent server for static, let's say http://static.server.com

    Static files, such as themes's js, css and images, and post attachments, are shared from the blogs to the static server through NFS mounted folders, so anything uploades to http://www.blog1.com/wp-content/uploads/ can be accessed on http://static.server.com/www.blog1.com/wp-content/uploads/ and in fact, any request to a statick file on http://www.blog1.com will get 301 redirected to static.

    I believe I should be able to take advantage of W3 Total Cache to avoid the redirection overhead, by forcing the plugin to rewrite the request, so that

    http://www.blog1.com/wp-content/w3tc/min/c88cca/index.include.2494227035.css
    gets rewritten to
    http://static.server.com/www.blog1.com/wp-content/w3tc/min/c88cca/index.include.2494227035.css
    instead of redirected on the fly.

    ¿Am I making any sense at all? It's like adding a forcer rewrite option for self managed CDN as those mounted through NFS.

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

  2. amenadiel
    Member
    Posted 4 years ago #

    Hmmm perhaps I can have a workaround by creating a CNAME which
    relates http://cdn.blog1.com to http://static.server.com/www.blog1.com/

  3. amenadiel
    Member
    Posted 4 years ago #

    New update: using the pull - mirror option and using static.server.com/www.blog1.com in the "Replace site's hostname with:" field, I have most of my statics rewritten as

    http://static.server.com/www.blog1.com/*

    FTW!

  4. godsofchaos
    Member
    Posted 4 years ago #

    Correct that should work nicely. Combining them into 1 file (through minify settings) should also work nicely and will rewrite them on the fly and will host them on the CDN at the same time.

  5. amenadiel
    Member
    Posted 4 years ago #

    Aye, and I should mount the wp-content/w3tc folder on with NFS pointing to the static server.

    Either that, or I should tamper with the plugin code to use the same folder as the images

  6. Garrett Cobarr
    Member
    Posted 4 years ago #

    This post is perfect timing for me as I use the same plugin and I am preparing for first light on my site this week. I have been using Firefox > Firebug > Page Speed to see how my various admin gymnastics are stacking up.

    I do have a question for wiser and more experienced heads, the efforts made here are not entirely insignificant. I have a single blog with no plans for more. I would like traffic and a very good experience for my readers/viewers, thus I am concerned about performance and would like to do whatever I can to insure that occurs.

    Being a longterm dev and coder in other areas, I know that the OCD fixation of the perfection performance can work a mighty grip. At what point should I be concerned and looking for CDNs and other efforts? Should I judge by my Page Speed scores, traffics numbers or when I see the torches and pitchforks of displeased users?

    BTW This is no comment on amenadiel, he clearly knows his path. Thanks for any thoughts.

  7. amenadiel
    Member
    Posted 4 years ago #

    Hmmm I can't seem to get it to work. I've tried changing define.php to define the following:

    define('WP_CONTENT_DIR_NAME', get_option('upload_path'));

    but all I get is a blank screen.

    I can get the constant defined before, right in w3-total-cache.php, but it doesn't stick, the constant remains empty during plugin's runtime.

  8. Frederick Townes
    Member
    Plugin Author

    Posted 4 years ago #

    @amenadiel, that define is not yet supported.

  9. amenadiel
    Member
    Posted 4 years ago #

    I worked my path through the constants and the file generation that take place when activationg the plugin. I moved all the files to the NFS mounted folder, for it's the only one with 755 permissions.

    The problem is that these minify files aren't executable nor rewrittable, because the static machine has no PHP and uses nginx as webserver. I ended up disabling the minify option which was one of the main features I wanted to see.

    I'll keep working on the issue. Perhaps object-cache.php, db.php and advanced-cache.php don't need to get duped onto the WP-CONTENT folder (in my case, the constant is WP-BZ-DIR which is /up (the NFS mounted one).

  10. Frederick Townes
    Member
    Plugin Author

    Posted 4 years ago #

    Perhaps object-cache.php, db.php and advanced-cache.php don't need to get duped onto the WP-CONTENT folder (in my case, the constant is WP-BZ-DIR which is /up (the NFS mounted one).

    Yes they do.

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