tomcat90
Forum Replies Created
-
Are you load balancing over multiple EC2’s? The W3 config settings write to a file. So if you have multiple EC2’s changing the settings won’t save the file on every EC2. Also, if you are load balancing whenever a new EC2 spins up it’s going to use whatever settings are in the deploy package. We are also on Amazon and we just have the config file set as part of the repo. So when we want to change settings we update the config file in the repo and then deploy to AWS.
Forum: Plugins
In reply to: [W3 Total Cache] W3 Total Cache don't work for multilang WordPress SiteI had the same issue. The problem is that W3 cache’s the base url. So if you are using https://www.yoursite.com for one and uk.yoursite.com for the other site you get issues. I fixed it by updating code in W3. I updated the function w3_get_home_url() to always use get_home_url() instead of looking up the cache. The function is in /w3-total-cache/inc/define.php The issue I had was the CDN. Because W3 uses the function below to match and replace. So what would happen is when I went to uk.site.com I would get uk.site.com/www.site.com/css/styles.css
This is my modified function:
function w3_get_home_url() {
static $home_url = null;
//Added this line to always set the home_url
$home_url = get_home_url();
if ($home_url === null) {
$config = w3_instance(‘W3_Config’);
if (w3_is_multisite() && $config->get_boolean(‘common.force_master’)) {
$home_url = get_home_url();
} else {
// This is the problem here
$home_url = $config->get_cache_option(‘wordpress.home’);
$home_url = rtrim($home_url, ‘/’);
}
}return $home_url;
}