• ejmc

    (@ejmc)


    Good morning, I’ve had a lot of success with this plugin, but keep running into an issue which I asm sure here is a solution to, but I can’t find it no matter how much Googling I do.

    I have two servers set up behind a load balancer, and because the config is done via the wp-admin site, even though it has a shared DB, I presume it is saving the settings in a file rather than the DB. The reason for that theory is that when I save the Page Cache setting for example, and refresh a few times, sometimes it will be checked, sometimes unchecked.

    Assuming that is true, what is the correct way to save these settings across multiple servers? This also seems to rear its head when some servers auto-deploy (we are using S3), as all of our Total Cache settings are sometimes completely zeroed out.

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • bgdstr

    (@bogdanstratulat)

    Hello,

    Yes, you are correct. The settings are saved in a static file: wp-content/w3tc-config/master.php . I have seen this happening before, and as a workaround, you can always make that file immutable once you have everything set up.
    I hope this helps.

    Having the same problem here.

    Why not use Redis to share settings across multiple servers?

    You might already be using Redis for Page Cache, Object Cache, PHP Sessions etc.

    define(‘W3TC_CONFIG_DATABASE’, true);
    define(‘W3TC_CONFIG_CACHE_ENGINE’, ‘redis’);
    define(‘W3TC_CONFIG_CACHE_REDIS_SERVERS’, ‘example-remote-redis-server.com’);
    define(‘W3TC_CONFIG_CACHE_REDIS_PASSWORD’, ‘some-pass’);
    define(‘W3TC_CONFIG_CACHE_REDIS_PERSISTENT’, true);
    define(‘W3TC_CONFIG_CACHE_REDIS_DBID’, 5);

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘How To Deploy Settings with Load Balancer’ is closed to new replies.